Re: Inserting text which contains newlines, using SQL

From: Bhooshan Prabhu <bhooshan.s.prabhu_at_orbitech.co.in>
Date: 14 May 2002 03:38:46 -0700
Message-ID: <16584988.0205140238.16edc1c4_at_posting.google.com>


Hello,

Can you try and concatenate chr(10) in your string. That should work I suppose.

Regards
Bhooshan

Thomas Okken <tokken_at_arrow.lz.att.com> wrote in message 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!
>
> Thanks!
>
> - Thomas Okken
Received on Tue May 14 2002 - 12:38:46 CEST

Original text of this message