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 ??
On Tue, 13 Jun 2000 18:25:31 GMT, dejaadas_at_my-deja.com wrote:
>I have the following script and would like it to take the
>$parm value as the &1 parameter. How can I do this ?
>--------------------------
>#! /bin/ksh
>
>parm='aaa'
>ORA_LOGIN=uid/pwd
>
>sqlplus -s $ORA_LOGIN << EOF read RtnCode
Interesting use of "read".... :-)
>set serverout on size 2000;
>DECLARE
>RC VARCHAR2(10) DEFAULT NULL;
>BEGIN
> RC := '&1'; -- &1 should be = $parm
Yup. But you got a problem with the " ' "s there. In theory they should stop the shell from interpreting $parm and substituting it. I'd try:
RC := \'$parm\';
> DBMS_OUTPUT.PUT_LINE(RC);
>END;
>/
>EOF
>--------------------------
>
HTH
Cheers
Nuno Souto
nsouto_at_nsw.bigpond.net.au.nospam
http://www.users.bigpond.net.au/the_Den/index.html
Received on Wed Jun 14 2000 - 00:00:00 CDT