If I have a stored procedure in oracle and I call it from a unix script, how do I pass the return_code(which is a out parameter in my procedure) to the unix script?
Printable View
If I have a stored procedure in oracle and I call it from a unix script, how do I pass the return_code(which is a out parameter in my procedure) to the unix script?
Use the same logic as your previous question on this topic... http://www.dbasupport.com/forums/sho...threadid=14119
Below is a copy of the code for passing the return code from oracle to unix. There are two input parameters and an out parameter in our procedure which we are trying to pass to the num variable in UNIX.
Help! An error is given upon execution
typeset num
num=`sqlplus -s <${USER}/${PASSWD}
exec update_status($3,'sending',num);
EOSQL
`
I would change update_status to a function. Then, I would use something like:
Code:num=`sqlplus -s ${USER}/${PASSWD} << EOSQL
exec dbms_output.put_line(update_status($3,'sending'));
EOSQL
`