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

Wraps results returned by queries on IBM_DB.

Methods

Public Class methods

Hold the given statement.

[Source]

     # File lib/sequel/adapters/ibmdb.rb, line 129
129:       def initialize(stmt)
130:         @stmt = stmt
131:       end

Public Instance methods

Return the number of rows affected.

[Source]

     # File lib/sequel/adapters/ibmdb.rb, line 134
134:       def affected
135:         IBM_DB.num_rows(@stmt)
136:       end

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

[Source]

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

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

[Source]

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

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

[Source]

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

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

[Source]

     # File lib/sequel/adapters/ibmdb.rb, line 160
160:       def field_precision(key)
161:         IBM_DB.field_precision(@stmt, key)
162:       end

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

[Source]

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

Free the memory related to this statement.

[Source]

     # File lib/sequel/adapters/ibmdb.rb, line 165
165:       def free
166:         IBM_DB.free_stmt(@stmt)
167:       end

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

[Source]

     # File lib/sequel/adapters/ibmdb.rb, line 171
171:       def free_result
172:         IBM_DB.free_result(@stmt)
173:       end

Return the number of fields in the result set.

[Source]

     # File lib/sequel/adapters/ibmdb.rb, line 176
176:       def num_fields
177:         IBM_DB.num_fields(@stmt)
178:       end

[Validate]