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: <xmark.powell_at_eds.com.x>
Date: 16 May 2001 13:31:33 GMT
Message-ID: <9dtvfl$33d$1@news.netmar.com>

In article <9dtqbp$7oh$1_at_bcarh8ab.ca.nortel.com>, Dina Ghatit <dghatit_at_nortelnetworks.com> writes:
>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.
>

I am not very experienced at writing shell scripts but something like this: seqdev 17 % cat mark4.ksh
#!/bin/ksh
sqlplus -s sefin/sefin <<EOF
variable id number
 BEGIN
   :id := 22;
 END;
/
print id
EOF
seqdev 18 % mark4.ksh >>testout
seqdev 19 % cat testout

PL/SQL procedure successfully completed.

        ID


        22

Received on Wed May 16 2001 - 08:31:33 CDT

Original text of this message

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