I am trying to pass a parameter to a SQL * Plus script from the command line, it usually works as follows:
sqlplus -s login/pass@sid @script.sql some_param
and in script.sql I can refer to parameters using ampersand, for example:
&1
Now I do this on Windows, and the first two parameters are overwritten with the "Files" line and in some way to the glogin.sql script - the rest of the parameters work fine. So, for example, when I call sqlplus as follows:
sqlplus -s login/pass@sid @script.sql par1 par2 par3 par4
and the script looks like this:
prompt &1
prompt &2
prompt &3
prompt &4
I get this output:
Files
(x86)\Oracle\product\11.1.0\client_1\\sqlplus\admin\glogin.sql
par3
par4
Any ideas what is going on?
source
share