Re: can a .sql file take parameters?

From: Arjan van Bentem <avbentem_at_DONT-YOU-DAREdds.nl>
Date: 1998/09/26
Message-ID: <6ui284$sd0$1_at_newton.a2000.nl>#1/1


Corinna Becker wrote
>instead of using &1 you can also use full names e.g. &parameter_one.

True, but then SQL*Plus will not use the values supplied on the command line for those varaibles. However, one could still use

    define my_name='&1'
    select table_name
    from all_tables
    where owner = upper ( '&my_name.' );

Note that you may use a dot to end the variable name: &my_name and &my_name. are the same. You'd really need the dot when you want the table name to be suffixed with some other text. Like &my_table_name asks for the value for my_table_name. However, &my_table._name asks for the value for my_table, and then concatenates the string _name to it. You will not see the dot in the output. Use two dots if you need a dot immideately after a variable name.

Arjan. Received on Sat Sep 26 1998 - 00:00:00 CEST

Original text of this message