Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: Use shell script parameter in sql script?!
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
![]() |
![]() |