Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: Help with PL/SQL

Re: Help with PL/SQL

From: Thomas Olszewicki <ThomasO_at_cpas.com>
Date: Fri, 03 Dec 1999 21:02:25 GMT
Message-ID: <BdW14.7759$75.558191@news1.rdc2.on.home.com>


Arthur,
A function must have at least one return statement: Try this:

  FUNCTION split_strsan(p_amt_field in out NUMBER,
                        p_StrSanAmts in out StrSanDat,
                        p_sub in NUMBER,
                        p_StrSanData in out StrSanTab) RETURN BOOLEAN IS

        lRtn Boolean ;

      BEGIN
     .
     .
     .
        lRtn := TRUE;
        RETURN lRtn;
     END;

You may consider using procedure insteed of function. Function returning Boolean cannot be used in SELECT ... statement anyway.

HTH
Thomas Olszewicki
ThomasO_at_cpas.com
www.cpas.com

<amerar_at_ci.chi.il.us> wrote in message news:82975a$kt5$1_at_nnrp1.deja.com...
>
>
> Hello,
>
> I am not well versed in PL/SQL so maybe someone can help me. I am
> trying to pass some variables to a function and, I want those variables
> returned from the function, since the function modifies the variables.
>
> Here is the declaration of my variables:
>
> type StrSanRec IS RECORD (
> v_adm_cost NUMBER := 0,
> v_off_amt1 NUMBER := 0,
> v_off_mis1 NUMBER := 0,
> v_off_amt2 NUMBER := 0,
> v_off_mis2 NUMBER := 0,
> v_off_amt3 NUMBER := 0,
> v_off_mis3 NUMBER := 0);
> type StrSanTab IS TABLE OF StrSanRec index by binary_integer;
> v_StrSanData StrSanTab;
>
> type StrSanDat is table of NUMBER index by binary_integer;
> v_StrSanAmts StrSanDat;
>
> v_amt_field NUMBER :=0;
> v_sub NUMBER :=0;
>
> Here is the call to my function:
>
> x:=split_strsan(v_amt_field, v_StrSanAmts, v_sub, v_StrSanData);
>
> And here is the beginning of the function:
>
> FUNCTION split_strsan(p_amt_field in out NUMBER,
> p_StrSanAmts in out StrSanDat,
> p_sub in NUMBER,
> p_StrSanData in out StrSanTab) RETURN BOOLEAN IS
> BEGIN
> .
> .
> .
>
> I get the following error:
>
> PLS-00503: RETURN <value> statement required for this return from
> function
>
> Any ideas? Is my syntax incorrect? Any help would be appreciated.
>
> Thanks,
>
> Arthur
> amerar_at_ci.chi.il.us
>
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
Received on Fri Dec 03 1999 - 15:02:25 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US