|
Re: Win NT variables in SQLPlus [message #370853 is a reply to message #370841] |
Fri, 18 February 2000 10:12 |
Ben
Messages: 48 Registered: January 2000
|
Member |
|
|
Daniel,
There at least three methods to do that, depending on your senarios. I'm giving you examples of using %username% in SELECT clause. Same principle applies to INSERT. I hope these help.
Method 1
--------
In nttoora.cmd file:
echo select '%username%' "USER" from dual; > nttoora.sql
echo exit >> nttoora.sql
plus80 scott/tiger @nttoora.sql
del nttoora.sql
NT command:
C:\nttoora.cmd
Method 2
--------
In nttoora.cmd file:
echo select '%1' "USER" from dual; > nttoora.sql
echo exit >> nttoora.sql
plus80 scott/tiger @nttoora.sql
del nttoora.sql
NT command:
C:\nttoora.cmd %username%
Method 3
--------
In nttoora.sql file:
set ver off
select '&1' "USER" from dual;
exit
NT command:
C:\plus80 scott/tiger @nttoora.sql %username%
Ben
|
|
|