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: Passing UNIX shell variables to a stored procedure

Re: Passing UNIX shell variables to a stored procedure

From: Anurag Varma <avarmadba.skipthis_at_yahoo.com>
Date: Mon, 03 Nov 2003 23:24:18 GMT
Message-ID: <CsBpb.32159$Q9.13430@nwrddc02.gnilink.net>

"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

Original text of this message

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