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

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
5e0c373d5d6bd91564d9b2cc795b16d7?d=identicon&s=25 phoenix (Guest)
on 2007-01-19 16: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.