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 -> Imbedded semicolon breaks insert statement -- why?

Imbedded semicolon breaks insert statement -- why?

From: Roy Smith <roy_at_panix.com>
Date: Mon, 08 Jan 2001 20:33:30 -0500
Message-ID: <roy-347340.20333008012001@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 Mon Jan 08 2001 - 19:33:30 CST

Original text of this message

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