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

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

Re: Use shell script parameter in sql script?!

From: <corky711_at_my-deja.com>
Date: Wed, 15 Sep 1999 01:36:05 GMT
Message-ID: <7rmt64$fp0$1@nnrp1.deja.com>


yes...try something like this:

in your sch script call my.sql script this way:

sqlplus <<EOF
@my.sql $1
...(bla-bla)
EOF and in my.sql you can refer to '$1' using &1 or &&1 e.g.,

select * from table where table='&1';

In article <37DDBFDF.D73DF23D_at_monmouth.com>,   Jack Zhu <jackzhu_at_monmouth.com> wrote:
> A shell script: "sch", I want to use it as "sch <parameter 1>".
> And in "sch" script, I also use 'sqlplus' to call a sql script which
is
> "my.sql".
>
> My question is, if in 'my.sql' I want to access the shell parameter
(s).
> What's the syntax?
>
> Can I use: instr('$1', '.') to access the first shell parameter?
>
> Thanks!
>
>

Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't. Received on Tue Sep 14 1999 - 20:36:05 CDT

Original text of this message

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