Oracle Spool 添加了额外的 LF
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/3940547/
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
Oracle Spool adds extra LF
提问by CC.
I have a Spool of a Select as :
我有一个选择的线轴:
SET SERVEROUTPUT ON
WHENEVER SQLERROR EXIT 1
set heading off
set feedback off
set termout off
set echo off
set verify off
set pagesize 0
set line 1000
set trimspool on
spool &1
SELECT '9' || 'c' || chr(10) || myColumn
FROM myTable;
spool off
set feedback on;
set term on;
exit;
The problem is that my output file is as folows:
问题是我的输出文件如下:
9c
17
9c
17
9c
17
9c
17
9c
17
So As you see I have my Line Feed after 'c' but it adds a new line feed after myColumn also. Any ideas how to solv it ? My file will be loaded in Unix. I've tryied with a CR instead but then I'll have lines with CR and others with LF. I think it will fail between Unix and Windows.
所以如你所见,我在“c”之后有我的换行符,但它也在 myColumn 之后添加了一个新的换行符。任何想法如何解决它?我的文件将在 Unix 中加载。我已经尝试使用 CR 代替,但随后我将使用 CR 和其他人使用 LF。我认为它会在 Unix 和 Windows 之间失败。
回答by Jeffrey Kemp
SET RECSEP OFF
SET RECSEP WRAPPED