Class | Sequel::IBMDB::Statement
In: | lib/sequel/adapters/ibmdb.rb
Parent: | Object

Wraps results returned by queries on IBM_DB.

### Methods

affected execute fetch_array field_name field_precision field_type free new num_fields

### Public Class methods

new(stmt)

Hold the given statement.

[Source]

         # File lib/sequel/adapters/ibmdb.rb, line 114
    114:       def initialize(stmt)
    115:         @stmt = stmt
    116:       end

### Public Instance methods

affected()

Return the number of rows affected.

[Source]

         # File lib/sequel/adapters/ibmdb.rb, line 119
    119:       def affected
    120:         IBM_DB.num_rows(@stmt)
    121:       end

execute(*values)

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

[Source]

         # File lib/sequel/adapters/ibmdb.rb, line 125
    125:       def execute(*values)
    126:         IBM_DB.execute(@stmt, values)
    127:       end

fetch_array()

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

[Source]

         # File lib/sequel/adapters/ibmdb.rb, line 130
    130:       def fetch_array
    131:         IBM_DB.fetch_array(@stmt) if @stmt
    132:       end

field_name(ind)

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

[Source]

         # File lib/sequel/adapters/ibmdb.rb, line 135
    135:       def field_name(ind)
    136:         IBM_DB.field_name(@stmt, ind)
    137:       end

field_precision(key)

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

[Source]

         # File lib/sequel/adapters/ibmdb.rb, line 145
    145:       def field_precision(key)
    146:         IBM_DB.field_precision(@stmt, key)
    147:       end

field_type(key)

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

[Source]

         # File lib/sequel/adapters/ibmdb.rb, line 140
    140:       def field_type(key)
    141:         IBM_DB.field_type(@stmt, key)
    142:       end

free()

Free the memory related to this result set.

[Source]

         # File lib/sequel/adapters/ibmdb.rb, line 150
    150:       def free
    151:         IBM_DB.free_result(@stmt)
    152:       end

num_fields()

Return the number of fields in the result set.

[Source]

         # File lib/sequel/adapters/ibmdb.rb, line 155
    155:       def num_fields
    156:         IBM_DB.num_fields(@stmt)
    157:       end

[Validate]