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: Is it possible to pass args. to a sql script

Re: Is it possible to pass args. to a sql script

From: Jim Smith <james-detg.smith_at_ubs.com>
Date: 1997/12/01
Message-ID: <34829513.2AA0E785@ubs.com>#1/1

Casper Thrane wrote:

> Hi
>
> I have a sql-script in a file which i execute from sql-plus, but is it
> possible to pass arguments when I execute this script?

IF you use numbered substitution variables, then command line parameters can be used.

eg
if script1.sql contains the following

select * from
atable
where col1='&1'
and col2='&2'
;

then either

sqlplus uname/pwd @script1 parm1 parm2

or

SQL>@script1 parm1 parm2

will do the trick. Received on Mon Dec 01 1997 - 00:00:00 CST

Original text of this message

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