Name

rows — Returns the number of rows processed by a statement

Synopsis

statementObj.rows

Description

#rows returns the number of rows processed by a statement. For SELECT statements, it returns the number of rows that have been fetched up to that point, not the total number of rows returned by the SELECT statement. For DDL statements, it returns zero.

Like other instance methods of Statement, calling this method after calling #finish will raise an exception. In particular, if a block is given to #execute or #fetch, the implicit #finish call will make #rows unavailable.