SQL * Plus command-line options overwritten in Windows

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?

+4
source share
1 answer

SQL * Plus Oracle 11gR2, :

dummy.sql script:

prompt &1
prompt &2
prompt &3
prompt &4

select 1 a from dual;

exit

:

E:\CFM\Dev\SQL>sqlplus -s guest/guest@DEV @dummy.sql 1 2 3 4
1
2
3
4

         A
----------
         1


E:\CFM\Dev\SQL>

:

  • - sqlplus native ( )?
  • ?

UPDATE: , , glogin.sql - , . , C:\oracle ( ), , , ...

, ( C:\oracle), , .

+3

Source: https://habr.com/ru/post/1530572/


All Articles