db-torque-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ramah" <ra...@gft.com>
Subject RE: Using Upper and Lower functions in Criteria
Date Sat, 20 Dec 2003 12:06:09 GMT
This works fine. 

Thank you,
Ramah

-----Original Message-----
From: David Hainlin [mailto:dhainlin@comcast.net]
Sent: Friday, December 19, 2003 7:06 PM
To: Apache Torque Users List
Subject: Re: Using Upper and Lower functions in Criteria


Ramah,
Try something on the order or (in employee_peer)
Criteria crit = new Criteria();
...
crit.add(ENAME, (Object) ("UPPER(" + ENAME + ") = '" + name.trim() + 
"'"), Criteria.CUSTOM);
...
List vals = doSelect(crit);

There may be other ways too but this technique  will work for lots of 
SQL situations (like date ranges, for example).
HTH
David

Ramah wrote:

> Is there any possibility to use UPPER and LOWER function of SQL in 
> Criteria?
>
> *Ex: Select eid from employee where upper(ename)='XYZ'.
> How to create Criteria for the above Query?*
>
> Thanks in Advance,
> Ramah
>




---------------------------------------------------------------------
To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
For additional commands, e-mail: torque-user-help@db.apache.org




---------------------------------------------------------------------
To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
For additional commands, e-mail: torque-user-help@db.apache.org


Mime
View raw message