oracle的文档上这样描述,
To spool output generated by commands in a script without displaying the output on the screen, use SET TERMOUT OFF. SET TERMOUT OFF does not affect output from commands run interactively.
可试验结果是这样的,
21:53:52 SQL> spool 1
18:33:08 SQL> set termout off
18:33:25 SQL> select * from duail;
select * from duail
*
ERROR at line 1:
ORA-00942: table or view does not exist
18:33:32 SQL> select * from dual;
D
-
X
18:33:40 SQL> show termout
termout OFF
哪位能给解释一下?为什么termout没有生效?
这个是要结合spool 和@来使用的。
把你的sql写成单个文件,然后再执行这个文件。
例如:
term.sql中的内容:
spool d:\orabak\term01.log
set term off
select *
from v$log;
spool off
@term.sql看一下。
然后再试试将term off 改为On,再看看.....