SQLPLUS allows dynamic variable substitution, from the command line.
Here's an example:
-- test1.sql
select count(1) from invoices where region=&1 ;
exit
-- Then, to run the SQL with the parm CANADA ..
os-prompt> sqlplus scott/tiger@myserver @test1.sql CANADA
Try running the SQL without that last parm - you will be prompted to key in the variable!
|
|