Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.tools -> Re: Unix shell script capturing return value of stored procedure
I noticed that the tmpVar := 321 will not work since the exit code varaible for sqlplus is limited to 1 byte (255 max value).
I changed this to...
tmpVar := 21;
In article <93d06b$v81$1_at_nnrp1.deja.com>,
kevinoleniczak_at_my-deja.com wrote:
> How do you write a shell script (ksh) to capture a return value from a
> stored function? If I have the following test fucntion...
>
> FUNCTION TESTME ( inName in VARCHAR2 ) RETURN NUMBER
> IS
> tmpVar NUMBER;
> BEGIN
> tmpVar := 321;
> RETURN tmpVar;
> END TESTME;
>
> And a script that looks like...
>
> sqlplus user/pwd <<PROCESS
> declare
> proc number;
> begin
> proc := TESTME ('$file');
> exit proc
> end;
> PROCESS
>
> echo $?
>
> I get the value 0 back which is incorrect.
>
> Any ideas?
>
> Sent via Deja.com
> http://www.deja.com/
>
Sent via Deja.com
http://www.deja.com/
Received on Mon Jan 08 2001 - 12:45:39 CST
![]() |
![]() |