Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> [Q] Reading clobs via sqlplus and trimming

[Q] Reading clobs via sqlplus and trimming

From: Stefan Leppert <Stefan.Leppert_at_gmx.net>
Date: 9 Dec 2002 10:29:30 -0800
Message-ID: <8c2093d0.0212091029.7b0b2906@posting.google.com>


Hi!

I try to retrieve a clob via sqlplus to process it in a shell script. The problem I encountered (and couldn't answer via google, sqlplusreference,...)  is, that sqlplus removes trailing spaces even *inside* the clob. If i switch trimming off I get too many blanks (filled up to linesize) otherwise too few! :(

Sample (Underscores=Spaces for readability):

sql> create table tbl (col1 clob);
sql> insert into tbl values('x_
y_
_z_');

SHELL> sqlplus -s <LOGIN>/<PWD> << EOF set verify off
set pagesize 0
set heading off
set feedback off
set recsep off
set colsep ""
set wrap on
set truncate off
set lin 4000
select * from tbl;
exit
EOF Result:
x
y
_z

Is there a way to do it or do I have to abandon sqlplus for this??

Thanks in advance,

Stefan Received on Mon Dec 09 2002 - 12:29:30 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US