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: Arjan van Bentem <avbentem_at_DONT-YOU-DAREdds.nl>
Date: 1998/09/24
Message-ID: <6udq1b$eqp$1@pascal.a2000.nl>#1/1

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 Thu Sep 24 1998 - 00:00:00 CDT

Original text of this message

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