Case insensitive LIKE query

8 views
Skip to first unread message

Naftoli Gugenheim

unread,
Aug 17, 2009, 3:24:15 PM8/17/09
to liftweb
I'm using H2, and LIKE queries seem to be case sensitive. What should I do to search fields without being case sensitive?
For example, right now I have:
        Client.findAll(Like(field, "%"+v+"%"))
In SQL I can write SELECT FIRST FROM CLIENT WHERE UPPER(FIRST) LIKE '%A%';
So is there a way to specify a database function in a query (without using SQL)?
Thanks.

Derek Chen-Becker

unread,
Aug 18, 2009, 10:58:55 AM8/18/09
to lif...@googlegroups.com
Currently I think that you would have to use BySQL. Feel free to file a ticket on it.

David Pollak

unread,
Aug 18, 2009, 2:56:45 PM8/18/09
to lif...@googlegroups.com

Fresh off the presses:

Cmp[O, String](field, OprEnum.Like, Full(value), Empty, Full("UPPER"))

You can include an SQL function in a Cmp.
 





--
Lift, the simply functional web framework http://liftweb.net
Beginning Scala http://www.apress.com/book/view/1430219890
Follow me: http://twitter.com/dpp
Git some: http://github.com/dpp
Reply all
Reply to author
Forward
0 new messages