Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: HELP: Embedded characters in SQL statement
Just double up a single quote:
select 'Wilson''s Products' wilson from dual;
WILSON
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
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
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
![]() |
![]() |