Re: Shell script to catch PL/SQL return values

From: Bit Twister <BitTwister_at_mouse-potato.com>
Date: Tue, 27 Jun 2006 09:18:24 -0500
Message-ID: <slrnea2fhg.68p.BitTwister_at_wb.home.invalid>


On 27 Jun 2006 03:49:17 -0700, send.vamsi_at_gmail.com wrote:
> Hello,
>
> I need some help from the experts on PL/SQL and Shell scripting. I need
> a shell script that runs a PL/SQL procedure and gets the values
> returned from the PL/SQL procedure into the shell variables. The PL/SQL
> procedure returns multiple values.
>
> I was able to assign a single return value from the SQL statement to
> the shell variable as below, but what about multiple values...

Spool results to a file and parse the file. You can use /set/ to parse items on a line and a while statement to read lines of a file. Example:

some_file.lst has
1 2
3 4
5 6

while read line
do
  set -- $line
  echo $1 $2
  echo $line
done < some_file.lst

All though it is not ksh this should give you some help http://tldp.org/LDP/abs/html/index.html Received on Tue Jun 27 2006 - 16:18:24 CEST

Original text of this message