Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: how to escape single quotes
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
![]() |
![]() |