class SQLite3::Database
def execute2( sql, *bind_vars )
See also #execute, #query, and #execute_batch for additional ways of
return at least one row--the names of the columns.
Thus, even if the query itself returns no rows, this method will always
from the result set.
always the names of the columns. Subsequent rows correspond to the data
first row returned (either via the block, or in the returned array) is
Executes the given SQL statement, exactly as with #execute. However, the
def execute2( sql, *bind_vars ) prepare( sql ) do |stmt| result = stmt.execute( *bind_vars ) if block_given? yield stmt.columns result.each { |row| yield row } else return result.inject( [ stmt.columns ] ) { |arr,row| arr << row; arr } end end end