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 131
131:       def initialize(stmt)
132:         @stmt = stmt
133:       end

Public Instance methods

Return the number of rows affected.

[Source]

     # File lib/sequel/adapters/ibmdb.rb, line 136
136:       def affected
137:         IBM_DB.num_rows(@stmt)
138:       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 142
142:       def execute(*values)
143:         IBM_DB.execute(@stmt, values)
144:       end

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

[Source]

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

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

[Source]

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

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

[Source]

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

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

[Source]

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

Free the memory related to this statement.

[Source]

     # File lib/sequel/adapters/ibmdb.rb, line 167
167:       def free
168:         IBM_DB.free_stmt(@stmt)
169:       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 173
173:       def free_result
174:         IBM_DB.free_result(@stmt)
175:       end

Return the number of fields in the result set.

[Source]

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

[Validate]