echo %USERNAME%Or, if you are on domain:
echo %USERDOMAIN%\%USERNAME%And keep in mind, SQL*Plus command host will open a command window, execute command and will close command window so you must have "photographic eye" to capture command output ;) .
Solomon Yakobson wrote:To avoid this you can use:
And keep in mind, SQL*Plus command host will open a command window, execute command and will close command window
host cmd /k echo %USERNAME%or
host cmd /k echo %USERDOMAIN%\%USERNAME%Then SQL*Plus will open command window, execute echo command and will not close command windows (since /k was used). You will have to manually issue exit command in command window to close it.
That is exactly the issue i was facing, the output disapperaed in fraction of seconds and i cannot see that.Of course that doesn't happen if you're running SQL*Plus from the CMD window itself :
C:\>sqlplus / as sysdba SQL*Plus: Release 22.214.171.124.0 Production on Ven. Sept. 21 11:15:17 2012 Copyright (c) 1982, 2010, Oracle. All rights reserved. Connected to: Oracle Database 11g Express Edition Release 126.96.36.199.0 - Production SQL> host echo %DATE% 21/09/2012