Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.tools -> Re: Calling PL/SQL procedure from sqlplus

Re: Calling PL/SQL procedure from sqlplus

From: andrew_webby at hotmail <spam_at_no.thanks.com>
Date: Wed, 16 May 2001 14:16:19 +0100
Message-ID: <990019042.18695.0.nnrp-01.c30bdde2@news.demon.co.uk>

Bit of a FAQ I'm afraid... how is CSH supposed to work out what the variable is? You are aware that starting SQL/Plus is a sub-process, and can't talk to parent CSH?

Try using backquotes to capture the output from sqlplus (so you may have to use dbms_output.put_line to output the value of id.)

"Dina Ghatit" <dghatit_at_nortelnetworks.com> wrote in message news:9dtqbp$7oh$1_at_bcarh8ab.ca.nortel.com...
> Hi,
> I've tried this and it does not work.
>
> #!/bin/csh -f
> touch /FWORKS/home/fwdev/sap_sql/sapcron/testcron
> export ORACLE_SID=fwdev
> echo "before call" >> /FWORKS/home/fwdev/sap_sql/sapcron/testcron
> function foo
> {
> sqlplus -s sapadm/sapadm2001<<EOF
> VARIABLE id NUMBER;
> BEGIN
> :id := SAPADM.SAP_I0040_WIP_QTY_BALANCE;
> END;
> /
> print id
> EOF
> }
> echo "after function" >> /FWORKS/home/fwdev/sap_sql/sapcron/testcron
> foo >> /FWORKS/home/fwdev/sap_sql/sapcron/testcron
>
> Any ideas?
> Thanks for your help.
>
>
>
Received on Wed May 16 2001 - 08:16:19 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US