开发者

spooling a clob value with multiple lines using sqlplus to a single cell of a CSV

开发者 https://www.devze.com 2023-04-09 03:44 出处:网络
I tried to spool a CLOB to a CSV file using code that looks like below: set pagesize 0 set heading off set long 30000

I tried to spool a CLOB to a CSV file using code that looks like below:

set pagesize 0
set heading off
set long 30000
set longchunksize 30000


SPOOL test.csv


select text from user_views;

But the above code returns the CLOB as multiple rows because of newline/carriage returns in the CLOB in the resulting CSV when viewed f开发者_如何学Pythonrom a spreadsheet program(OOcalc). Is there anyway to keep the whole CLOB intact in a single cell?


You'll probably want to look at the DBMS_LOB package for ideas on how to get the data out of there cleanly.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号