PDA

View Full Version : getting output parameter of proc inside shell scripts


Manikandan
03-27-03, 07:46
Hi,
I have one shell script (Korn shell). In which am calling an oracle procedure which returns an output parameter. I need to use this parameter inside my shell script.

What could be the solution for this?????

:confused:

sathyaram_s
03-27-03, 12:41
Assuming your Oracle procedures output is a single line, pipe the output to 'read x' and use the variable x as you would any shell variable

Cheers

Sathyaram


Originally posted by Manikandan
Hi,
I have one shell script (Korn shell). In which am calling an oracle procedure which returns an output parameter. I need to use this parameter inside my shell script.

What could be the solution for this?????

:confused:

Manikandan
03-28-03, 01:12
Hi,
Thanks a lot...
Suppose,
I have the shell script like this:


cd $RD
sqlplus $UID/$PWD<<!> aio.log
exec PROC_GET_PARM
!


Inside this how can i use this..I am not clear with your answer.
Please reply

sathyaram_s
03-28-03, 11:27
I do not know of this sqlplus construct inside a shell script ....

So let me give an example based on what I know ...

echo "Your record" | read x
echo $x

will give the output as

Your record

So, if you apply the same to your script , I think, it will look like ..
cd $RD
sqlplus $UID/$PWD<<!> aio.log
exec PROC_GET_PARM
! | read x

echo $x

should give the output ...

If you have headers etc in the output, you should be careful to eliminate them, maybe using a head and/or tail commands ...

HTH

Cheers

Sathyaram






Originally posted by Manikandan
Hi,
Thanks a lot...
Suppose,
I have the shell script like this:


cd $RD
sqlplus $UID/$PWD<<!> aio.log
exec PROC_GET_PARM
!


Inside this how can i use this..I am not clear with your answer.
Please reply

Manikandan
03-28-03, 11:42
Hi,
Thanks a lot satya...