From: Johan Veenstra Date: 2006-12-19T18:09:11+09:00 Subject: Re: string of strings... ------=_Part_905_31425679.1166519347501 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline On 12/19/06, Martin DeMello wrote: > > On 12/19/06, Josselin wrote: > > I got an array of id's : > > > > ids = [22443, 22468, 22371, 22218, 22472, 22377, 22245] > > > > I would like to get a string of strings (to be used in SQL > WHERE..IN clause > > > > " '22443' , ' 22468' , ' 22371' , ' 22218' , '22472' , '22377' , > '22245' " > > > > If a use ids.join(','), I get > > "22443,22468,22371,22218,22472,22377,22245" which is obviously not > > useful for SQL.... > > ids.map {|i| "'#{i}'"}.join(" ,") > > martin > "'#{ids.join("','")}'" Johan ------=_Part_905_31425679.1166519347501--