Qx v0.7
Qt Extensions Library
|
The SqlResult class provides sequential, efficient access to a SELECT/DQL query result. More...
#include <qx/sql/qx-sqlresult.h>
Public Member Functions | |
SqlResult () | |
int | at () const |
bool | isEmpty () const |
bool | isValid () const |
bool | next () |
int | size () const |
SqlError | value (T &value) const |
Friends | |
class | SqlDqlQuery |
This class acts as an alternative way to process query results that is more efficient than the execution methods that simply return a container. Similar to a plain QSqlQuery, rows are navigated one at a time and the value(s) from them are constructed on-demand via value() instead of all at once.
A valid result obtained via executing a query will begin before the first row (if any), like QSqlQuery.
|
inline |
Constructs an invalid SqlResult.
|
inline |
Returns the current position of the query. The first record is at position zero. If the position is invalid, the function returns QxSql::BeforeFirstRow or QxSql::AfterLastRow, which are special negative values.
|
inline |
Returns true
if the result returned no rows; otherwise, returns false
.
|
inline |
Returns true
if the result is currently positioned on a row of a successful; otherwise, returns false
.
|
inline |
Advances the result to the next row.
Returns true
if there was another row, or false
if the end of the result was reached.
|
inline |
Returns the size of the result.
|
inline |
Sets value to contain the data from the current row.
Returns a valid error object with error info if the data could not be retrieved.