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 -> Re: [Q] Reading clobs via sqlplus and trimming

Re: [Q] Reading clobs via sqlplus and trimming

From: <Christopher.Jones_at_oracle.comX>
Date: 10 Dec 2002 11:05:35 +1100
Message-ID: <ufzt6d9gw.fsf@oracle.comX>

Stefan.Leppert_at_gmx.net (Stefan Leppert) writes:
> 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, sqlplus-
> reference,...) 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_');
>

> Result:
> x
> y
> _z

Nothing non-hacky springs to mind. (Hacky solution is to pre-process, replacing spaces with a token, and post processing to reconvert the token.)

Out of interest, why are the trailing spaces important to you?

Chris

-- 
Christopher Jones, Oracle Corporation, Australia.
Received on Mon Dec 09 2002 - 18:05:35 CST

Original text of this message

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