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: Escape character for & in strings.

Re: Escape character for & in strings.

From: Kenneth C Stahl <kstahl_at_lucent.com>
Date: Fri, 25 Jun 1999 08:10:26 -0400
Message-ID: <377371B2.D522473C@lucent.com>


Oh, is that what you want to know. You should have said so from the start.

Simply enter the following command in your script before you execute the sql:

set define off

As long as you are not using substitution variables in your sqlplus script you'll be ok. If you are, then simply set define to some other innocuous character that doesn't have a significane to Oracle.

Ken

"C." wrote:

>
> insert into icecream VALUES ('Ben & Jerry''s');
>
> what happens is:
> Enter value for jerry:
>
> Not what I want to happen. I have code that is trying to do the
> insert, so
> I run each string through some checker code looking for the apostrophe
> and it
> alters the string to contain two single quotes, but what about the &
> character.
>
> Now, the following insert statement would work:
> insert into icecream values ('Ben ' || '&' || ' Jerry''s');
>
> I could make my code rewrite the string into that format, but give me
> a
> break? Isn't there a better solution?
>
Received on Fri Jun 25 1999 - 07:10:26 CDT

Original text of this message

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