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: can a .sql file take parameters?

Re: can a .sql file take parameters?

From: Corinna Becker <Corinna.Becker_at_removethis.memo.ikea.com>
Date: 1998/09/25
Message-ID: <01bde87e$5d14a7c0$a049100a@pc743-sode.seurope.ikea.com>#1/1

Hello,
instead of using &1 you can also use full names e.g. &parameter_one. Regards
Corinna Becker

Arjan van Bentem <avbentem_at_DONT-YOU-DAREdds.nl> wrote in article <6udq1b$eqp$1_at_pascal.a2000.nl>...
> Thenardier wrote
> >as title. than how can i do it? if not, what should i do?
>
>
> Yes, &1 will give you the first parameter, &2 the second, etc. SQL*Plus
 will
> replace &1 etc. prior to trying to execute the SQL statement, so you need
 to
> include quotes etc. Like:
>
> select table_name
> from all_tables
> where owner = upper ( '&1' );
>
> You can call this script, when named my_script.sql, using
>
> SQL> start my_script.sql scott
>
> or
>
> $> sqlplus scott/tiger @my_script.sql scott
>
> If you ommit the parameter values, SQL*Plus will ask for them.
>
> Arjan.
>
>
>
>
Received on Fri Sep 25 1998 - 00:00:00 CDT

Original text of this message

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