From: Jim Weirich Date: 2005-05-28T00:39:36+09:00 Subject: Re: dbi: passing parameters to execute David Jacobs said: How do I pass values when my sql-code is something like > *** > select * > from bla > where > year IN ? > *** > > Is this possible? Do I have to pass an array of integers? (I guess not > because it doesn't work...) I've been googling alot to find any help, > in vain -- I'm clueless. I don't think passing in an array will work (in all cases). But you might try this (warning: untested code): sql = "select * from bla where year in (" + values.collect{'?'}.join(',') + ")"; db.select_all(sql, values) do |row| # process row end -- -- Jim Weirich jim@weirichhouse.org http://onestepback.org ----------------------------------------------------------------- "Beware of bugs in the above code; I have only proved it correct, not tried it." -- Donald Knuth (in a memo to Peter van Emde Boas)