Method: Rubyfb::Connection#execute

Defined in:
lib/src.rb

#execute(sql, transaction) {|row| ... } ⇒ Object

This function executes a SQL statement against a connection. If the statement represented a SQL query then a ResultSet object is returned. If the statement was a non-query SQL statement then an Integer is returned indicating the number of rows affected by the statement. For all other types of statement the method returns nil. The method also accepts a block that takes a single parameter. This block will be executed once for each row in any result set generated.

Parameters

sql

The SQL statement to be executed.

transaction

The transaction to execute the SQL statement within.

Exceptions

Exception

Generated if an error occurs executing the SQL statement.

Yields:

  • (row)


340
341
342
# File 'lib/src.rb', line 340

def execute(sql, transaction)
   yield(row)
end