What I'd like to do is write SQL scripts which will accept a variable number of command line
parameters. The parameters which aren't specified would then either be null or have some
Other people seem to have wanted this too, as there are a few posts on the web about
how to do this with sqlplus.
The crux of the matter is that I have a solution to the above problem which works with sqlplus,
but it doesn't work if you run the same script from inside SQL Developer.
This bothers me, because I like SQL Developer, and i use it for all my oracle work, as far as possible.
I don't want to have to use sqlplus for some tasks, and SQL developer for others. I think you know what
Anyway, this is the solution for sqlplus :
set termout off
col p1 new_value 1
col p2 new_value 2
col p3 new_value 3
select null p1, null p2, null p3 from dual where 1=2;
select nvl('&1','def1') p1, nvl('&2','def2') p2, nvl('&3','def3') p3 from dual;
set termout on
If you run this script from SQLplus, you get the following functionality :