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

Home -> Community -> Usenet -> c.d.o.server -> Re: Use shell script parameter in sql script?!

Re: Use shell script parameter in sql script?!

From: Jim Tench <jim_tench_at_spam.me.baby>
Date: Tue, 14 Sep 1999 18:41:36 +0100
Message-ID: <937330897.4620.0.nnrp-11.c1ed5616@news.demon.co.uk>


Not sure you really wanted to escape the $1 in that example....

Jim

Kenneth C Stahl <BlueSax_at_Unforgettable.com> wrote in message news:37DE351F.45AB49AB_at_Unforgettable.com...
> Mario Bucsics wrote:
>
> > No, but if you pass parameters to the shell script you can
> > use the &1 &2 &3 ... in your sql script.
> >
> > Mario Bucsics
> >
> > * Sent from RemarQ http://www.remarq.com The Internet's Discussion
Network *
> > The fastest and easiest way to search and participate in Usenet - Free!
>
> Of course shell variables can be used. Try this:
>
> #!/bin/ksh
> sqlplus -s scott/tiger <<-sqlEOF
> set pages 0;
> set feedback off;
> select *
> from emp
> where empno = '$1';
> exit success;
> sqlEOF
> exit 0;
>
>
>
Received on Tue Sep 14 1999 - 12:41:36 CDT

Original text of this message

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