comp • gb.db • result

Result (gb.db)

This class represents the result of a SQL request.

This class is not creatable.
This class acts like a
Returns the value of a field in the current record of the Result object.
read
/
Modifies the value of a field in the current record of the Result object.
write
array.
This class is
Enumerates all records in the Result object by moving its internal cursor. The order of the enumeration is predictable; such as in the case of using the "ORDER BY" clause.
enumerable
with the FOR EACH keyword.

Properties

Methods
Returns True if the result object contains one or more accessible database rows.
Available  
Returns the parent connection object.
Connection  
Returns the number of rows in the query result "cursor". - If, and only if, ...
Count  
Returns a collection of the fields of the result.
Fields  
Returns the index of the current record, starting from zero.
Index  
This is a synonymous for the Count property.
Length  
Returns Result.Count - 1 (as long as the count is >= 0, otherwise -1 is returned).
Max  
Deletes the current record.
Delete  
Moves to the first record of the result.
MoveFirst  
Moves to the last record of the result.
MoveLast  
Moves to the next record of the result.
MoveNext  
Moves to the previous record of the result.
MovePrevious  
Moves to a specified record.
MoveTo  
Updates the current record into the database, if this record has been modified and the Result is a read/write cursor.
Update  

Result Cursors

The Result object is a cursor i.e. a view of a constrained set of rows arising from the execution of the query by the database engine. The cursor, depending on how it was executed may or may not "lock" rows and tables in the database. Such locking enables guaranteed updates to be made to data in the database by only one user at a time. (This is fundamental to rdbms theory.)

In the Gambas db world these cursors are described, naturally enough, as read only and read/write. Different result returning commands from the Connection class return different cursor types:

Command

Result Type
Create Read/Write
Edit Read/Write
Exec Read Only
Find Read Only