简体   繁体   English

为什么 sqlplus spoolfile 切割最后一列?

[英]Why sqlplus spoolfile cutting last column?

i have problems with spooling file to.csv.我在将文件假脱机到.csv 时遇到问题。 Sqlplus cutting off last column name and I don't know why? Sqlplus 把最后一列名截断了,不知道为什么? I am trying to set bigger linesize but it doesn't work.我正在尝试设置更大的线条尺寸,但它不起作用。

Thanks for any tips感谢您的任何提示

set embedded on 
set pagesize 0
set linesize 600
set colsep ';'
set echo off
set feedback off
--set trimspool off
set headsep off
SET HEADING OFF   
SET TRUNCATE OFF
SET WRAP OFF

column_1 AS COLUMN1, column_2 AS COLUMN2, column_3 AS COLUMN3, 'FAKEMESSAGE' as COLUMN4

And COLUMN4 is cut, I see just string "COL"并且 COLUMN4 被剪切,我只看到字符串“COL”

I already solved the problem - when you want to use to your select some unexisted column, in my case - 'FAKEMESSAGE' as COLUMN4 - in real select i had just 'FAKE' as COLUMN4 - and COLUMN4 was just COLU - i know why - because when the column doesnt really exist in the table/database, the table dont really know how big the column should be, so it copy the size of inputed value and the same size of string put on the name of column, so if you want to have header size of 8 strings char, you have to setup first OR the input value have to be at the same size...我已经解决了这个问题 - 当你想使用你的 select 一些不存在的列时,在我的例子中 - 'FAKEMESSAGE' 作为 COLUMN4 - 在真正的 select 中我只是 'FAKE' 作为 COLUMN4 - 而 COLUMN4 只是 CO因为当表/数据库中确实不存在该列时,该表真的不知道该列应该有多大,所以它复制输入值的大小和放在列名上的相同大小的字符串,所以如果你想要要让 header 大小为 8 个字符串 char,您必须先设置或输入值必须相同大小...

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM