If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > Unix Shell Scripts > getting output parameter of proc inside shell scripts

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 03-27-03, 06:46
Manikandan Manikandan is offline
Registered User
 
Join Date: Aug 2002
Location: India
Posts: 60
Arrow getting output parameter of proc inside shell scripts

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?????

__________________
Thanks & Regards
Manikandan
Reply With Quote
  #2 (permalink)  
Old 03-27-03, 11:41
sathyaram_s sathyaram_s is offline
Super Moderator
 
Join Date: Aug 2001
Location: UK
Posts: 4,543
Re: getting output parameter of proc inside shell scripts

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


Quote:
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?????

Reply With Quote
  #3 (permalink)  
Old 03-28-03, 00:12
Manikandan Manikandan is offline
Registered User
 
Join Date: Aug 2002
Location: India
Posts: 60
getting output parameter of proc inside shell scripts

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
__________________
Thanks & Regards
Manikandan
Reply With Quote
  #4 (permalink)  
Old 03-28-03, 10:27
sathyaram_s sathyaram_s is offline
Super Moderator
 
Join Date: Aug 2001
Location: UK
Posts: 4,543
Re: getting output parameter of proc inside shell scripts

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






Quote:
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
Reply With Quote
  #5 (permalink)  
Old 03-28-03, 10:42
Manikandan Manikandan is offline
Registered User
 
Join Date: Aug 2002
Location: India
Posts: 60
Getting output parameter of proc inside shell script

Hi,
Thanks a lot satya...
__________________
Thanks & Regards
Manikandan
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On