Re: Calling a pl/sql procedure from SQLPLUS in HP UNIX`

From: Sybrand Bakker <postbus_at_sybrandb.demon.nl>
Date: Tue, 15 May 2001 22:01:20 +0200
Message-ID: <tg32kfncjkhk85_at_beta-news.demon.nl>


"Dina Ghatit" <dghatit_at_nortelnetworks.com> wrote in message news:9drub6$2rh$1_at_bcarh8ab.ca.nortel.com...
> I'm using execute function in sqlplus and it is not working.
>
> sqlplus << EOF
> sapadm/sapadm2001_at_fwdev
> VARIABLE id NUMBER
> execute-
> :id := SAPADM. SAP_I0040_WIP_QTY_BALANCE;
> echo 'id' >> filename
>
> Can you help?
>
>

export ORACLE_SID=fwdev
function foo
{
sqlplus -s sapadm/sapadm2001 <<EOF
variable id number;
begin
:id := SAPADM. SAP_I0040_WIP_QTY_BALANCE; end;
/
print id
EOF
}
foo >> filename

The general id of this your output need to go to stdout (and of course 'echo' is sh or ksh, not sqlplus). Once it does go to stdout, it can be used in normal redirection and filtering procedures. The -s option surpresses the sqlplus banner.

Hth,

Sybrand Bakker, Oracle DBA Received on Tue May 15 2001 - 22:01:20 CEST

Original text of this message