Class DBIRecordset[in The DBI Falcon Module.]

Represent a collection of database records as required from DBIBaseTrans.query. You will not instantiate this class directly, instead, you must use DBIBaseTrans.query.

class DBIRecordset

Summary

asBlobID()Get a field value as a blob ID string.
asBoolean()Get a field value as a Boolean.
asDate()Get a field value as a TimeStamp object with the date populated and the time zeroed.
asDateTime()Get a field value as a TimeStamp object.
asInteger()Get a field value as an Integer.
asInteger64()Get a field value as an Integer64.
asNumeric()Get a field value as a Numeric.
asString()Get a field value as a String.
asTime()Get a field value as a TimeStamp object with time populated and date zeroed.
close()Close a recordset
fetchArray()Get the next record as an Array.
fetchDict()Get the next record as a Dictionary.
fetchObject()Get the next record as an Object.
getColumnCount()Return the number of columns in the recordset.
getColumnNames()Get the column names as an array.
getColumnTypes()Get the column types as an array.
getLastError()Get the last error that occurred in this recordset from the database server.
getRowCount()Get the number of rows in the recordset.
next()Advanced the record pointer to the next record.

Methods

asBlobID()

Get a field value as a blob ID string.

DBIRecordset.asBlobID( idx, [bID] )

idxfield index
bIDA pre-allocated string buffer that will be filled with blob ID.
Returns:A string value that can be used to retreive the content of a blob field.

The value returned by this function can be then feed into blob related methods in the DBITransaction class, as the DBITransaction.readBlob method.

If the bID parameter is not provided, the function will create a new string and then return it; if it is provided, then the given string buffer will be filled with the blob ID data, and eventually returned on success.

Reusing the same item and filling it with new fetched values can be more efficient by several orders of magnitude.

asBoolean()

Get a field value as a Boolean.

DBIRecordset.asBoolean( idx )

idxfield index
Returns:Boolean representation of database field contents or nil if field content is nil

asDate()

Get a field value as a TimeStamp object with the date populated and the time zeroed.

DBIRecordset.asDate( idx, [timestamp] )

idxfield index
timestampA TimeStamp object that will be filled with the data in the field.
Returns:TimeStamp representation of database field contents or nil if field content is nil

If the timestamp parameter is not provided, the function will create a new instance of the TimeStamp class and then return it; if it is provided, then that object will be filled and also returned on succesful completion.

Reusing the same object and filling it with new fetched values can be more efficient by several orders of magnitude.

asDateTime()

Get a field value as a TimeStamp object.

DBIRecordset.asDateTime( idx, [timestamp] )

idxfield index
timestampA TimeStamp object that will be filled with the data in the field.
Returns:TimeStamp representation of database field contents or nil if field content is nil

If the timestamp parameter is not provided, the function will create a new instance of the TimeStamp class and then return it; if it is provided, then that object will be filled and also returned on succesful completion.

Reusing the same object and filling it with new fetched values can be more efficient by several orders of magnitude.

asInteger()

Get a field value as an Integer.

DBIRecordset.asInteger( idx )

idxfield index
Returns:Integer representation of database field contents or nil if field content is nil

asInteger64()

Get a field value as an Integer64.

DBIRecordset.asInteger64( idx )

idxfield index
Returns:Integer64 representation of database field contents or nil if field content is nil

asNumeric()

Get a field value as a Numeric.

DBIRecordset.asNumeric( idx )

idxField index.
Returns:Numeric representation of database field contents or nil if field content is nil

asString()

Get a field value as a String.

DBIRecordset.asString( idx, [string] )

idxfield index
stringA pre-allocated string buffer that will be filled with the content of the field.
Returns:String representation of database field contents or nil if field content is nil.

If the string parameter is not provided, the function will create a new string and then return it; if it is provided, then the given string buffer will be filled with the contents of the field and also returned on succesful completion.

Reusing the same item and filling it with new fetched values can be more efficient by several orders of magnitude.

asTime()

Get a field value as a TimeStamp object with time populated and date zeroed.

DBIRecordset.asTime( idx, [timestamp] )

idxField index.
timestampA TimeStamp object that will be filled with the data in the field.
Returns:TimeStamp representation of database field contents or nil if field content is nil

If the timestamp parameter is not provided, the function will create a new instance of the TimeStamp class and then return it; if it is provided, then that object will be filled and also returned on succesful completion.

Reusing the same object and filling it with new fetched values can be more efficient by several orders of magnitude.

close()

Close a recordset

DBIRecordset.close( )

fetchArray()

Get the next record as an Array.

DBIRecordset.fetchArray( )

Returns:populated array or nil on EOF.

fetchDict()

Get the next record as a Dictionary.

DBIRecordset.fetchDict( )

Returns:populated dictionary or nil on EOF.

fetchObject()

Get the next record as an Object.

DBIRecordset.fetchObject( obj )

objObject to populate with row data.
Returns:populated object or nil on EOF

Please refer to the documentation of DBIRecord for more information on using the DBIRecord class.

getColumnCount()

Return the number of columns in the recordset.

DBIRecordset.getColumnCount( )

Returns:Integer

getColumnNames()

Get the column names as an array.

DBIRecordset.getColumnNames( )

Returns:String array of column names

getColumnTypes()

Get the column types as an array.

DBIRecordset.getColumnTypes( )

Returns:Integer array of column types

getLastError()

Get the last error that occurred in this recordset from the database server.

DBIRecordset.getLastError( )

Returns:String containing error message

This error message is specific to the database server type currently in use.

getRowCount()

Get the number of rows in the recordset.

DBIRecordset.getRowCount( )

Returns:Integer

next()

Advanced the record pointer to the next record.

DBIRecordset.next( )

Returns:true if successful, 0 if not successful, usually meaning the EOF has been hit.

All new queries are positioned before the first record, meaning, next should be called before accessing any values.


Made with faldoc 2.0.0