Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Passing UNIX shell variables to a stored procedure
"Brad" <brsimmon_at_mobility.com> wrote in message
news:7fba17f9.0311031335.7cfc54e2_at_posting.google.com...
> Hello,
>
> I have a few stored procedures in Oracle 8i and am interested in
> passing UNIX shell variables to some of them upon execution. Is that
> possible and if so how do I go about it?
>
> Thanks in advance,
> Brad.
Try something like this (beware: not tested!)
myscript.ksh
#!/bin/ksh
sqlplus /nolog <<EOT
connect user/pass
@myscript.sql $1 $2
exit;
...
And then refer to the variables in your sql script like this:
myscript.sql
exec myproc('&1','&2');
..... assuming 1 & 2 are characters ... change accordingly to your specs...
Anurag Received on Mon Nov 03 2003 - 17:24:18 CST
![]() |
![]() |