2 Replies Latest reply: Aug 27, 2013 5:42 AM by Soofi RSS

    REP-1401: 'no_daysformula':Fatal PL/SQL error occured. ora-06503: PL/SQL : Functio returned without value. REP-0619: You cannot run without a layout.

    Vijetha

      Hi everyone.

      Can anyone tell me what is wrong in this code below?

      Code:

      function NO_DAYSFormula return Number is

      begin

        IF TO_CHAR(TO_DATE(:P_FR_DT, 'DD-MM-RRRR'), 'RRRR') =TO_CHAR(TO_DATE(:ACCT_OPN_DT, 'DD-MM-RRRR'), 'RRRR')

        AND :P_TO_DT<:MATURITY_DATE

        AND :ACCT_OPN_DT>:P_FR_DT

        THEN RETURN (:P_TO_DT-:ACCT_OPN_DT+1);

       

        ELSIF TO_CHAR(TO_DATE(:P_FR_DT, 'DD-MM-RRRR'), 'RRRR') =TO_CHAR(TO_DATE(:ACCT_OPN_DT, 'DD-MM-RRRR'), 'RRRR')

        AND :P_TO_DT<:MATURITY_DATE

        AND :ACCT_OPN_DT<:P_FR_DT

        THEN RETURN (:P_FR_DT-:P_TO_DT+1);

       

        ELSIF TO_CHAR(TO_DATE(:P_FR_DT, 'DD-MM-RRRR'), 'RRRR') =TO_CHAR(TO_DATE(:ACCT_OPN_DT, 'DD-MM-RRRR'), 'RRRR')

         AND :P_TO_DT>:MATURITY_DATE

         AND :ACCT_OPN_DT<:P_FR_DT

        THEN RETURN (:P_FR_DT-:MATURITY_DATE+1);

       

        END IF;

      END;

       

      It gets compiled successfully but when i run the report, i get 2 errors.

      Error 1:

      REP-1401: 'no_daysformula':Fatal PL/SQL error occurred.

      ora-06503: PL/SQL : Function returned without value.

      Error 2:

      REP-0619: You cannot run without a layout.

       

      Should i use only 1 return statement?

      Can i use as many return statements as i want?

      What is the exact mistake? Please let me know.

       

      Thank You.