Forum: Ruby on Rails query keywords with capitalization insensitive in Oracle

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
phoenix (Guest)
on 2007-01-19 17:30
(Received via mailing list)
There is a case:the name of my song in Oracle is called "love
love",and I need find it out whenever user query by "Love","love" or
"lOVe",and so on.I used this sentance:
Song.find(:all,:conditions=>['lower(name) like ?','%'+@keyword+'%'])
It's just fine in Oracle,but it cann't work with MySQL.That is, when I
change my DB from Oracle to MySQL,I will need change my query
sentance,that's bad! Is there some better way to finish my work?Thx!
This topic is locked and can not be replied to.