From: Eric Christopherson Date: 2013-03-01T10:40:24+09:00 Subject: Re: How to translate the following sqlite3 insert statement into equivalent mysql insert statement On Thu, Feb 28, 2013 at 7:18 PM, Yu W. wrote: > Thanks a lot for reply! I've tried mysql gem. But it doesn't allow > expression like this > "(#{(['?'] * keys.size).join(',')})", *values" > > it says mysql query method only allows one parameter. Oh, sorry. It's been a while since I did this, but I believe you have to call Mysql#prepare on the string containing the '?' placeholders, which returns a Mysql::Stmt object. Call #execute on that object with the *values. That's how it works with the Mysql2 gem, anyway; see http://zetcode.com/db/mysqlrubytutorial/ .