Class DBI::DBD::Mysql::Statement
In: lib/dbd/mysql/statement.rb
Parent: DBI::BaseStatement

Models the DBI::BaseStatement API to create DBI::StatementHandle objects.


bind_param   column_info   execute   fetch   fetch_scroll   fill_array   finish   new   rows  

Included Modules


Public Class methods

Public Instance methods

See DBI::BaseStatement#bind_param. This method will also raise DBI::InterfaceError if param is not a Fixnum, to prevent incorrect binding.

See DBI::BaseStatement#column_info, and DBI::DBD::Mysql::Database#columns.

This method provides all the attributes the columns method provides, and a few others:

  • mysql_type: These correspond to constants in the Mysql::Types package, in the lower-level ‘mysql’ package.
  • mysql_type_name: A text representation of mysql_type.
  • mysql_length: The length of the column.
  • mysql_max_length: The max length of the column. FIXME DESCRIBE DIFFERENCE
  • mysql_flags: Internal MySQL flags on this column.

See DBI::BaseStatement#execute. If DBI thinks this is a query via DBI::SQL.query?(), it will force the row processed count to 0. Otherwise, it will return what MySQL thinks is the row processed count.

See DBI::BaseStatement#fetch_scroll. These additional constants are also supported:

  • DBI::SQL_FETCH_PRIOR: Fetch the row previous to the current one.
  • DBI::SQL_FETCH_FIRST: Fetch the first row.
  • DBI::SQL_FETCH_ABSOLUTE: Fetch the row at the offset provided.
  • DBI::SQL_FETCH_RELATIVE: Fetch the row at the current point + offset.

Helper method to aid fetch. Do not call directly.