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

Home -> Community -> Usenet -> c.d.o.server -> Re: return a vlaue from procedure to unix shell help ..

Re: return a vlaue from procedure to unix shell help ..

From: Martin Haltmayer <Martin.Haltmayer_at_0800-einwahl.de>
Date: 2000/04/15
Message-ID: <38F87F5D.C0F69A02@0800-einwahl.de>#1/1

Try

#
IN_PARA='INPAR'
DUMMY=''
OUT_PARA=''
export OUT_PARA
sqlplus -s username/password <<endsql | fgrep vartag | read DUMMY OUT_PARA set echo off
set feedback off
set linesize 800
set pagesize 0
set timing off
set trimspool on
set verify off
variable l_out_para varchar2 (2000)
exec STORED_PROCEDURE($IN_PARA,:l_out_para); select 'vartag ' || :l_out_para from dual; endsql
#
echo 'Following are the Unix outputs'
#
echo $IN_PARA >> VALUE_PASSED.DAT
echo $OUT_PARA >> VALUE_RETURNED.DAT

Martin

Mujahid Hamid wrote:
>
> Hi All,
>
> I am calling a stored procedure from Unix shell.
>
> I can pass value to the procedure but I cannot return a
> value back to the Unix and store it in Unix shell variable.
>
> Is there a way where I can return a value from a stored procedure
> to Unix shell script and store it in the Unix shell variable
>
> Following is what I am trying to do.
> I am stuck on this please help ....
>
> Many Thanks
>
> Mujahid
>
> #
> IN_PARA='INPAR'
> OUT_PARA=''
> sqlplus -s username/password <<endsql
> exec STORED_PROCEDURE($IN_PARA,$OUR_PARA);
> endsql
> #
> echo 'Following are the Unix outputs'
> #
> echo $IN_PARA >> VALUE_PASSED.DAT
> echo $OUT_PARA >> VALUE_RETURNED.DA
Received on Sat Apr 15 2000 - 00:00:00 CDT

Original text of this message

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