hi paul,

sorry i missed this one. ojb does not change the parameter of the criteria, so imo this is simply an sql-problem.

jakob

Nase, Paul R. wrote:

Thanks Jakob,

But I want to find objects that contain the actual '%' character, I don't want to search for objects using the '%' as the one or more wildcard.

The addLike("attribute","P%") will return all records starting with the letter 'P'. So this query will search using the '%' as the normal sql wildcard, it won't query for items that actually contain the '%' character.

Paul

-----Original Message-----
From: Jakob Braeuchi [mailto:[EMAIL PROTECTED] Sent: Thursday, February 19, 2004 12:29 PM
To: OJB Users List
Subject: Re: Query with criteria - like using '%' or '_'


hi paul,

use addLike("your_attribute","P%")

hth
jakob

Nase, Paul R. wrote:


I would like to perform a query where a description could have a '%' or an '_'. Is this possible using QueryByCriteria?

Example:
ID          DESCRIPTION
-------     --------------------
10000       40% Member Discount
10001       Online Discount

I'd like to be able to search using a like statement similar to: "Where Description like '%\%%' ESCAPE '\'"

The current implementation will just strip off the escape character, resulting in passing my literal '\%' being pass as a wildcard.

Thanks in advance.

Paul Nase

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to