Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: URGENT !! How do I pass a parameter to this script ??
> #! /bin/ksh
>
> parm='aaa'
> ORA_LOGIN=uid/pwd
>
> sqlplus -s $ORA_LOGIN << EOF read RtnCode
> set serverout on size 2000;
> DECLARE
> RC VARCHAR2(10) DEFAULT NULL;
> BEGIN
> RC := '&1'; -- &1 should be = $parm
Yes, it should
> DBMS_OUTPUT.PUT_LINE(RC);
> END;
> /
> EOF
And " read RtnCode" should be removed.
Even shorter :
#! /bin/ksh
parm='aaa'
ORA_LOGIN=un/pw
sqlplus -s $ORA_LOGIN << EOF
set serverout on size 2000;
DECLARE
BEGIN
DBMS_OUTPUT.PUT_LINE('$parm');
END;
/
EOF
Received on Wed Jun 14 2000 - 00:00:00 CDT