|
Re: How do I store the output parameter of an oracle procedure into a unix variable? [message #97088 is a reply to message #97085] |
Fri, 23 November 2001 08:21 |
andrew again
Messages: 2577 Registered: March 2000
|
Senior Member |
|
|
Repalce each '~' with a '<' (posting of double '<' doesnt work).
#!/bin/ksh
RETVAL=`sqlplus -s scott/pass ~~EOF
set serveroutput on
WHENEVER SQLERROR EXIT 1
declare
x number;
begin
x := 999;
dbms_output.put_line('the_result_is '||x);
end;
/
exit;
EOF`
echo $RETVAL
X=`echo $RETVAL | awk '{print $2}'`
echo $X
sqlplus -s scott/pass ~~EOF | read RETVAL
set serveroutput on
WHENEVER SQLERROR EXIT 1
declare
x number;
begin
x := 999;
dbms_output.put_line('the_result_is '||x);
end;
/
exit;
EOF
echo $RETVAL
X=`echo $RETVAL | awk '{print $2}'`
echo $X
----------------------------------------------------------------------
|
|
|