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: Malcolm Dew-Jones <yf110_at_vtn1.victoria.tc.ca>
Date: 10 Dec 2002 16:19:06 -0800
Message-ID: <3df6847a@news.victoria.tc.ca>


Christopher.Jones_at_oracle.comX wrote:

: 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.)

Perhaps convert the data to something like base64 before saving it. Then you have simple lines of text data to save (which might not even need a clob).

After extracting using sqlplus, then the shell script runs it through a base64 decoder as part of what it does.

$0.02 Received on Tue Dec 10 2002 - 18:19:06 CST

Original text of this message

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