class Sequel::IBMDB::Statement

  1. lib/sequel/adapters/ibmdb.rb
Superclass: Object

Wraps results returned by queries on IBM_DB.

Public Class methods

new(stmt)

Hold the given statement.

[show source]
    # File lib/sequel/adapters/ibmdb.rb
125 def initialize(stmt)
126   @stmt = stmt
127 end

Public Instance methods

affected()

Return the number of rows affected.

[show source]
    # File lib/sequel/adapters/ibmdb.rb
130 def affected
131   IBM_DB.num_rows(@stmt)
132 end
execute(*values)

If this statement is a prepared statement, execute it on the database with the given values.

[show source]
    # File lib/sequel/adapters/ibmdb.rb
136 def execute(*values)
137   IBM_DB.execute(@stmt, values)
138 end
fetch_array()

Return the results of a query as an array of values.

[show source]
    # File lib/sequel/adapters/ibmdb.rb
141 def fetch_array
142   IBM_DB.fetch_array(@stmt) if @stmt
143 end
field_name(ind)

Return the field name at the given column in the result set.

[show source]
    # File lib/sequel/adapters/ibmdb.rb
146 def field_name(ind)
147   IBM_DB.field_name(@stmt, ind)
148 end
field_precision(key)

Return the field precision for the given field name in the result set.

[show source]
    # File lib/sequel/adapters/ibmdb.rb
156 def field_precision(key)
157   IBM_DB.field_precision(@stmt, key)
158 end
field_type(key)

Return the field type for the given field name in the result set.

[show source]
    # File lib/sequel/adapters/ibmdb.rb
151 def field_type(key)
152   IBM_DB.field_type(@stmt, key)
153 end
free()

Free the memory related to this statement.

[show source]
    # File lib/sequel/adapters/ibmdb.rb
161 def free
162   IBM_DB.free_stmt(@stmt)
163 end
free_result()

Free the memory related to this result set, only useful for prepared statements which have a different result set on every call.

[show source]
    # File lib/sequel/adapters/ibmdb.rb
167 def free_result
168   IBM_DB.free_result(@stmt)
169 end
num_fields()

Return the number of fields in the result set.

[show source]
    # File lib/sequel/adapters/ibmdb.rb
172 def num_fields
173   IBM_DB.num_fields(@stmt)
174 end