Hi, how do i use passed in arguments and convert those to something sql
can understand? do the aliases have to be double qouted? single qouted?
i think i tried all but no avail…thanks!
def get_count(doctype, towne)
@profiles = Profile.count_by_sql(“SELECT COUNT(*) from Profiles where
Profiles.doctype_id = 1 and town_id = towne”)
Hi, how do i use passed in arguments and convert those to something sql
can understand? do the aliases have to be double qouted? single qouted?
i think i tried all but no avail…thanks!
def get_count(doctype, towne)
@profiles = Profile.count_by_sql(“SELECT COUNT(*) from Profiles where
Profiles.doctype_id = 1 and town_id = towne”)
end
Try
Profile.count_by_sql([“SELECT COUNT(*) from Profiles where
Profiles.doctype_id = ? and town_id = ?”, doctype, towne])
Hi Stephan,
i have the same issue as discuss here. i try above given link but
it is not working. could you give me the other link or some direction to
avoid the Double Quotes problem.
Thanks
Salil
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.