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: C. <c_ferguson_at_rationalconcepts.com>
Date: Thu, 24 Jun 1999 19:39:17 -0700
Message-ID: <3772EBD5.ABD8402C@rationalconcepts.com>


Hi Stevie,
  Thanks for your answer. But, what is the char(?) for &. Here's the hypothetical example:
  create table icecream (brand varchar2(100));

  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?

Thanks for your thoughts.
Cindy Received on Thu Jun 24 1999 - 21:39:17 CDT

Original text of this message

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