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

Home -> Community -> Usenet -> c.d.o.misc -> Re: HELP: Embedded characters in SQL statement

Re: HELP: Embedded characters in SQL statement

From: Daniel Clamage <dclamageNOSPAM_at_telerama.com>
Date: 1998/02/20
Message-ID: <01bd3d82$09b1ec20$9929c9cd@saturn>#1/1

Just double up a single quote:
select 'Wilson''s Products' wilson from dual; WILSON



Wilson's Products

All other non-single-quote characters (like double-quotes) don't need you to do anything special:
select 'double quotes are "OK" too' ok from dual; OK



double quotes are "OK" too

If the single quotes are really pissing you off, replace them with CHR(39) instead:
select 'Wilson' || CHR(39) || 's Products' wilson2 from dual; WILSON2



Wilson's Products

T'was Brillig,
And the slithy toves
Did gyre and gimbol in the wabe;
All mimsey were the borogroves,
And the mome raths outgrabe.
- Lewis Carroll

no_at_spam.allowed wrote in article
<MPG.f49162c463c4c769896e5_at_news.wwa.com>...
> I would like to know how to submit an SQL statement which has imbedded
> characters such as an apostrophe or quotation-mark in them. For example,
> SQL_Statement="Select * from myTable where companyName = 'Wilson's
> Products'"
> As you can see, the word Wilson's contains an embedded apostrophe.
> Is there an acceptable method whereby I can submit this value without the
 

> apostrophe causing a problem?
Received on Fri Feb 20 1998 - 00:00:00 CST

Original text of this message

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