From: yudi Date: 2007-12-12T12:34:08+09:00 Subject: Re: Inject SQL Statement in Rails ------=_Part_25783_33128193.1197430444823 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline You can use find_by_sql to use MySQL directly: @object.find_by_sql("SELECT course_id FROM degrees WHERE programme_id = 1 ") @object will be referenced with an array of entries from database. On Dec 11, 2007 9:22 PM, Jojo Mojo wrote: > Hi, > > I have a simple SQL statement which I would like to inject in my web > application. The SQL statement is: > > Select course_id > from degrees > where programme_id = 1 > > I need to know the step by step on how to make this work. What changes > should be made to the model, view or controller? Urgent. Please reply > asap. > Thank you very much! > -- > Posted via http://www.ruby-forum.com/. > > -- Do not be afraid of Change. ------=_Part_25783_33128193.1197430444823--