How to capture procedure out parameter value into unix variable?

Database
Enthusiast

How to capture procedure out parameter value into unix variable?

Hi,
the following is my stored procedure:
sp_getstatus(OUT o_status varchar(10), INOUT io_msg varchar(300))

I am calling the above stored procedure in unix via bteq as follows:

bteq &1
${LOGON} ;
call sp_setstatus('TDSTATUS','TDMSG'(varchar (300)));
.if errorlevel <>0 then .quit 2
.if activitycount = 0 then .quit 1
.quit 0
EOF

When i do:
echo $TDSTATUS
echo $TDMSG

it returns empty.
However, the output by stored procedure to the logfile is correct and display the values

Thanks,
-srinivas yelamanchili

2 REPLIES
Enthusiast

Re: How to capture procedure out parameter value into unix variable?

you can't dump the o/p variable of stored proc directly to the shell.

The approach you should take is probably do a .export to a file and read it from there..
Enthusiast

Re: How to capture procedure out parameter value into unix variable?

Thanks Joe, will do that.
-srinivas