From: Andreas Warberg Date: 2008-05-30T21:26:23+09:00 Subject: Re: How do i replace actual value in the query with variables? Ting Chang wrote: > for q in 0..4 > s = Float(q) > > conn.exec( 'UPDATE SCH_EVENT SET P_ID = 2444334 where RANK= s AND > playlist_id=432') > > end How about: for q in 0..4 conn.exec("UPDATE SCH_EVENT SET P_ID = 2444334 where RANK=#{q.to_f} AND playlist_id=432") end The main difference is the use of " instead of '. Andreas -- Posted via http://www.ruby-forum.com/.