Put a blackslash (\) in front of the single quote (') should fix your problem.
For you particular example,
the quer should look like: select * from name_table where name like '%\'%'.
-- Laiwu
"Doshi, Gunjan" wrote:
> Friends:
>
> My Servlet queries the DB2 database table. However some entries in the
> column have ' as its entries. I want to search for all of them
>
> Example: O' Peter. I am talking of the single quote ' in the name.
>
> So when I say select * from name_table where name like '%'%'
>
> It is wrong because single quotes because %'% is illegal within ' '. How do
> I do it.
>
> Gunjan
>
> ___________________________________________________________________________
> To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
> of the message "signoff SERVLET-INTEREST".
>
> Archives: http://archives.java.sun.com/archives/servlet-interest.html
> Resources: http://java.sun.com/products/servlet/external-resources.html
> LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
--
Laiwu Luo
Global Crossing Telecommunications, Inc.
Systems & Product Development
Email: [EMAIL PROTECTED]
Phone: 248-647-6920 Ext. 4010
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html