Quote:
Originally Posted by satnamx
Does anyone have any solutions for passing back multiple variables back to the SHELL from a call to an ORACLE procedure:
$ a=($(printf "%s;\n" "set pages 0 serverout on feed off" \
> "exec dbms_output.put_line('Line1')" \
> "exec dbms_output.put_line('Line2')" \
> | sqlplus -s / as sysdba))
$ echo ${a[0]}
Line1
$ echo ${a[1]}
Line2
or:
$ printf "%s;\n" "set pages 0 serverout on feed off" \
> "exec dbms_output.put_line('Line 1')" \
> "exec dbms_output.put_line('Line 2')" \
> | sqlplus -s / as sysdba \
> | { read var1;
> read var2;
> echo "var1 is $var1 , var2 is $var2"
> }
var1 is Line 1 , var2 is Line 2
Regards
Dimitre