Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Help with PL/SQL
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
![]() |
![]() |