Results 1 to 5 of 5
  1. #1
    Join Date
    Aug 2002
    Location
    India
    Posts
    60

    Arrow Unanswered: 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

  2. #2
    Join Date
    Aug 2001
    Location
    UK
    Posts
    4,650

    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


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


  3. #3
    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

  4. #4
    Join Date
    Aug 2001
    Location
    UK
    Posts
    4,650

    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






    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

  5. #5
    Join Date
    Aug 2002
    Location
    India
    Posts
    60

    Getting output parameter of proc inside shell script

    Hi,
    Thanks a lot satya...
    Thanks & Regards
    Manikandan

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •