SQL sqlplus 假脱机:如何摆脱第一个空行?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/5576901/
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 10:03:29  来源:igfitidea点击:

sqlplus spooling: How to get rid of first, empty line?

sqlsqlplusspoolfixed-length-file

提问by Tagar

I'm doing the following spooling statement:

我正在执行以下假脱机语句:

SET VERIFY OFF
SET FEEDBACK OFF
SET HEADING OFF
SET TRIMSPOOL ON
SET TERM OFF
SPOOL &pathRelations
START scripts/relations.sql &parent
SPOOL OFF
SET TERM ON

The scripts/relations.sqlfile contains a simple selectstatement.

scripts/relations.sql文件包含一个简单的select语句。

Unfortunately, the spooled file contains an empty line as the first one in the file. This line causes trouble in our framework.

不幸的是,假脱机文件包含一个空行作为文件中的第一行。这条线会给我们的框架带来麻烦。

Of course I could get rid of these line through sedbut ain't there a way to suppress its creation in the first place?

当然,我可以摆脱这些线,sed但一开始就没有办法抑制它的创建吗?

回答by Tagar

SET NEWPAGE NONEis the correct answer.

SET NEWPAGE NONE是正确答案。

SET NEWPAGE 0will cause a page feed, which is not what the OP wants.

SET NEWPAGE 0将导致页面提要,这不是 OP 想要的。

回答by Tagar

SET NEWPAGE 0

see here

这里