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

Home -> Community -> Usenet -> c.d.o.tools -> Re: Unix shell script capturing return value of stored procedure

Re: Unix shell script capturing return value of stored procedure

From: <kevinoleniczak_at_my-deja.com>
Date: Mon, 08 Jan 2001 18:45:39 GMT
Message-ID: <93d1sf$v1$1@nnrp1.deja.com>

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

Original text of this message

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