Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.tools -> Re: apostrophe in Oracle field
Zhiliang Hu wrote:
> There must be someone encounterred and have a solution to this problem:
>
> When you have a " ' " (apostrophe) among some text data in a table
> field,
> it causes trouble when you do, for example:
>
> > select * from table where name='O'Brian':
>
> ERROR:
> ORA-01756: quoted string not properly terminated
>
> Any general approach to avoid this?
>
> Thanks in advance!
>
> Zhiliang
Zhiliang,
You need to use two quotes in a row to negate the meaning of the quotes.
select * from table where name = 'O''Brian';
This should work.
-- Troy Meyerink Oracle DBA Raytheon EROS Data Center USGS meyerink_at_usgs.govReceived on Tue Apr 24 2001 - 16:22:11 CDT
![]() |
![]() |