From: Charles Mills Date: 2005-01-09T00:46:28+09:00 Subject: Re: DBI Question Dominik Werder wrote: > > stmt = db.prepare(sql) > > array = stmt.execute(*bind_vars).fetch_all > > stmt.finish # free resources / locks held by the statement > > thanks a lot!! > there is a small mistake in your code but you pointed me into the right > direction :) > stmt.execute returns nil so you have to do: > > stmt.execute > array=stmt.fetch_all > Oh, looks like the DBI spec doesn't say what #execute should return: http://ruby-dbi.sourceforge.net/DBI_SPEC.html IMO returning self would be the most natural... another option: array = db.select_all(sql, *bind_vars) -Charlie