BCHodo-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
2007-Oct-05 15:01 UTC
Using wildcards in ActiveRecord Bind parameters
I am trying to have ActiveRecord do the following: Select * from myTable where ( ucase(name) like ''%findname%'' ) But when I do this in: @resultList = Entity.find(:all, :conditions => ["ucase(name) like ?", "%name%"]) I end up with: SELECT * FROM myTable WHERE ( ucase(name) like ''%''findname''%'') ActiveRecord puts single quotes around both of the wildcards, thus giving me an SQL Syntax error. What should I be doing to get this to work? --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---