Command line parameters for sql script ? [message #314744] |
Thu, 17 April 2008 12:34 |
McLan
Messages: 36 Registered: April 2008
|
Member |
|
|
I have sql script named do_needful.sql, this does some processing.
I want to pass input parameter for this script (some thing like command line parameters in unix shell script) as below:
sqlplus> @do_needful.sql <inputfile or input parameter>
is this possible?
Regards,
McLan
|
|
|
|
|
Re: Command line parameters for sql script ? [message #314754 is a reply to message #314749] |
Thu, 17 April 2008 13:04 |
|
Michel Cadot
Messages: 68712 Registered: March 2007 Location: Saint-Maur, France, https...
|
Senior Member Account Moderator |
|
|
Quote: | How to access input parameter in do_needful.sql?
|
&1, &2... (like $1, $2... in Unix shell).
SQL*PlusŪ User's Guide and Reference
Quote: | if (command_line_pram_value > 5) then
|
SQL*Plus does not contain a language it is just a basic line tool.
You have to use PL/SQL for this but what you can do depends on what you want to do. PL/SQL does not interact with client but you can pass and get back values to/from PL/SQL.
Regards
Michel
|
|
|