Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: [Q] Reading clobs via sqlplus and trimming
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