Method: SQLite3::Statement#execute!
- Defined in:
- lib/sqlite3/statement.rb
#execute!(*bind_vars, &block) ⇒ Object
Execute the statement. If no block was given, this returns an array of rows returned by executing the statement. Otherwise, each row will be yielded to the block.
Any parameters will be bound to the statement using #bind_params.
Example:
stmt = db.prepare( "select * from table" )
stmt.execute! do |row|
...
end
See also #bind_params, #execute.
87 88 89 90 |
# File 'lib/sqlite3/statement.rb', line 87 def execute!( *bind_vars, &block ) execute(*bind_vars) block_given? ? each(&block) : to_a end |