Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Imbedded semicolon breaks insert statement -- why?

Re: Imbedded semicolon breaks insert statement -- why?

From: Peter Dickmann <peter.dickmann_at_sema-telecoms.com>
Date: Fri, 12 Jan 2001 17:12:57 +0100
Message-ID: <3a5f2d0a@news.lhsgroup.com>

In principle SQL*Plus is line-oriented. There might exist better solutions, however, if you could survive with eliminating the newline's, you could add a hyphen (-) at the end of each line; this would result in a single line, since the hyphen is the continuating character. Or replace all smicolons by a special character and vice versa when selecting. Or avoid SQL*Plus.

Peter

Roy Smith <roy_at_panix.com> wrote in message news:roy-347340.20333008012001_at_news.panix.com...
> If I do something like:
>
> create table foo (
> id integer,
> text varchar2(2000)
> );
>
> insert into foo values (
> 1, 'this is a very long string
> which wraps around several lines;
> in fact, three of them');
>
> I get a syntax error when I feed it to sqlplus. Apparantly, what's going
 on
> is the ";" imbedded in the text field makes sqlplus think the statement is
> terminated. I would have thought the quotes would protect it. According
 to
> the Oracle SQL Reference, the only character which needs to be escaped
 inside
> a quoted string is a quote.
>
> Two questions:
>
> 1) Is this really an error, or is sqlplus broken?
>
> 2) Regardless of the answer to the above, what's the best way around the
> problem? The sql files in question will be machine generated, so it has
 to
> be something that's easy to generate mechanically.
Received on Fri Jan 12 2001 - 10:12:57 CST

Original text of this message

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