Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: can a .sql file take parameters?
Hello,
instead of using &1 you can also use full names e.g. ¶meter_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