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: how to escape single quotes

Re: how to escape single quotes

From: Mark Gumbs <mgumbs_at_hotmail.com>
Date: Wed, 29 Sep 1999 12:35:13 +0100
Message-ID: <37f1f6d0.0@145.227.194.253>


Not to my knowledge. Someone else may know of another method. You either have to do

vName := 'this is some text. It''s got an apostrophe in it'; or
vName := 'this is some text. It' || chr(39) || 's got an apostrophe in it'

M

kev <kevin.porter_at_fast.no> wrote in message news:37F1F2A5.7F7531B3_at_fast.no...
> Hi,
>
> How do I guard against single quotes in text messing up my SQL
> statements. For example, I have some text like:
>
> 'this is some text. It's got an apostrophe in it'
>
> ie there's inadvertantly 3 single quotes there, which ruin the SQL
> statement. I could URL-encode the text first and URL-decode it
> afterwards (using PHP), but is there a 'proper' way to encode it (in
> Oracle 8)?
>
> tia,
>
> - Kev
>
Received on Wed Sep 29 1999 - 06:35:13 CDT

Original text of this message

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