SQL 抑制 sqlplus 中变量替换的输出

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/5340716/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-01 09:44:25  来源:igfitidea点击:

Suppress output of variables substitution in sqlplus

sqlvariablessqlplus

提问by

I'd like to suppress the output of such lines as the following ones

我想抑制以下行的输出

old   9: AND FROMDAT <= TO_DATE('&duedate', 'YYYYMMDD')
new   9: AND FROMDAT <= TO_DATE('20091031', 'YYYYMMDD')
old  10: AND TODAT > TO_DATE('&duedate', 'YYYYMMDD')
new  10: AND TODAT > TO_DATE('20091031', 'YYYYMMDD')

How could I achieve this?

我怎么能做到这一点?

TERM OFFand FEEDBACK OFFis already set.

TERM OFF并且FEEDBACK OFF已经设置。

回答by

SET VERIFY OFFis the answer.

SET VERIFY OFF是答案。

回答by alexherm

SET VERIFY OFF does suppress the parameter substitution dialogue, but it does not prevent the parameter entry (Enter value for..) chatter from being written to output.

SET VERIFY OFF 确实会抑制参数替换对话,但它不会阻止将参数输入(输入值...)的抖动写入输出。

However if you combine that with SET HEADING OFF you will have output that includes only return data with no garbage at the top.

但是,如果您将其与 SET HEADING OFF 结合使用,您将获得仅包含返回数据且顶部没有垃圾的输出。

I use this when I need to have a sqlplus program return XML output to an Oracle concurrent request.

当我需要让 sqlplus 程序将 XML 输出返回到 Oracle 并发请求时,我会使用它。