try this:
Program does not execute properly (rts 114 error or -207 ) when
the search string has an embedded apostrophe and double quotes e.g.:
"O'Donnel". The problem is resolved when the 'Use ANSI quoted
identifiers' is removed from the driver configuration or the string
is formed as 'O''Donnell'.
Character constants must be enclosed in single quotation marks
(') or double quotation marks ("). Enclosing a character constant
in single quotation marks is always allowed and is the recommended
practice. Enclosing a character constant in double quotation marks
is sometimes not allowed when the 'Use ANSI quoted identifiers'
option is set ON.
robert young
-----Original Message-----
From: A mailing list for discussion about Sun Microsystem's Java Servlet
API Technology. [mailto:[EMAIL PROTECTED]]On Behalf Of
Doshi, Gunjan
Sent: Friday, May 12, 2000 4:25 PM
To: [EMAIL PROTECTED]
Subject: Re: Database and Servlet
Tried it:
This is the result
COM.ibm.db2.jdbc.app.DB2Exception: [IBM][CLI Driver][DB2] SQL0104N An
unexpected token "%" was found following "". Expected tokens may include:
"FOR WITH ORDER UNION EXCEPT OPTIMIZE ". SQLSTATE=42601
> ----------
> From: Laiwu Luo[SMTP:[EMAIL PROTECTED]]
> Reply To: A mailing list for discussion about Sun Microsystem's Java
> Servlet API Technology.
> Sent: Friday, May 12, 2000 4:08 PM
> To: [EMAIL PROTECTED]
> Subject: Re: Database and Servlet
>
> 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
>
___________________________________________________________________________
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
___________________________________________________________________________
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