假脱机测试.sql:
SPOOL test.log
CLEAR SCREEN
SET VERIFY OFF
PROMPT Queries will appear in spool
select sys_context('USERENV', 'INSTANCE_NAME') from dual;
PROMPT Output from the HOST command will not
HOST ECHO %COMPUTERNAME%
SPOOL OFF
sqlplus 输出:
Queries will appear in spool
SYS_CONTEXT('USERENV','INSTANCE_NAME')
---------------------------------------------------
wibble
Output from the HOST command will not
AWESOMESERVERNAME
SQL>
测试日志:
Queries will appear in spool
SYS_CONTEXT('USERENV','INSTANCE_NAME')
--------------------------------------------------------------------------------
wibble
Output from the HOST command will not
如果无法捕获 HOST 输出,有人可以提出解决方法。