Re: HELP: Embedded characters in SQL statement
Date: 1998/02/20
Message-ID: <01bd3d82$09b1ec20$9929c9cd_at_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
- Dan Clamage
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 CET