Inserting text which contains newlines, using SQL
Date: Mon, 13 May 2002 18:39:23 -0400
Message-ID: <3CE0409B.15BEA840_at_arrow.lz.att.com>
Hi all,
Is there a reliable way to insert text which contains newlines using
SQL?
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".
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.
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
-- Thomas Okken AT&T Labs, 200 Laurel Ave S., room A4-1A33, Middletown, NJ 07748 email: tokken_at_arrow.lz.att.com phone: (732)-420-8063Received on Tue May 14 2002 - 00:39:23 CEST