Re: Inserting text which contains newlines, using SQL

From: Ban Spam <ban-spam_at_operamail.com>
Date: Mon, 13 May 2002 23:09:04 GMT
Message-ID: <Xns920DA44CDE855SunnySD_at_68.6.19.6>


Thomas Okken <tokken_at_arrow.lz.att.com> wrote in news:3CE0409B.15BEA840_at_arrow.lz.att.com:

> Hi all,
>
> Is there a reliable way to insert text which contains newlines using
> SQL?
> I know it's easy using JDBC and a prepared statement, but I would like
> to figure out how to do it interactively in sql*plus, or in a SQL
> script.
>
> I have found this to work somewhat:
>
> insert into sometable values ( 'somekey', 'This is text with
> an embedded newline.');
>
> If you check the table, there is now a string in there with a newline
> between the words "with" and "an".
> This is fine so far, but this does not work if you have a blank line
> (two consecutive newlines, or two newlines separated only by space
> characters); if sql*plus sees a blank line it simply cancels the current
> command.
>
> Is there a way around this? I'd appreciate any ideas!
>

'Line 1 ' || CHR(10) || 'Line 2' Received on Tue May 14 2002 - 01:09:04 CEST

Original text of this message