Try this:

find_by_sql("SELECT column1 FROM table WHERE column2 = ? ORDER BY column1",params[:gm])

More here: 
http://api.rubyonrails.org/classes/ActiveRecord/Base.html#method-c-find_by_sql

Walter

On Sep 17, 2010, at 11:01 AM, PalaniKannan K wrote:

Dear all,

I need to apply "find" instead of find_by_sql. Kindly suggest me. Because, params[gm] is not working with find_by_sql. Kindly justify whether my code below is in correct syntax...

find_by_sql("SELECT column1 FROM table WHERE column2 = 'params[gm]' ORDER BY column1")

--
With Regards
Palani Kannan. K
Office: +49-531-2616-226
Mobile: +4917647098166


--
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- [email protected]. To unsubscribe from this group, send email to [email protected] . For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en .

--
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 [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to