8#include <QtSql/qtsqlglobal.h>
9#include <QtCore/qvariant.h>
10#include <QtCore/qcontainerfwd.h>
20class QSqlResultPrivate;
24 Q_DECLARE_PRIVATE(QSqlResult)
25 friend class QSqlQuery;
29 virtual ~QSqlResult();
30 virtual QVariant
handle()
const;
38 explicit QSqlResult(
const QSqlDriver * db);
47 const QSqlDriver*
driver()
const;
48 virtual void setAt(
int at);
51 virtual void setQuery(
const QString& query);
57 virtual bool prepare(
const QString& query);
59 virtual void bindValue(
int pos,
const QVariant& val, QSql::ParamType type);
60 virtual void bindValue(
const QString& placeholder,
const QVariant& val,
61 QSql::ParamType type);
62 void addBindValue(
const QVariant& val, QSql::ParamType type);
63 QVariant
boundValue(
const QString& placeholder)
const;
68#if QT_SQL_REMOVED_SINCE(6
, 6
)
69 QList<QVariant> &boundValues()
const;
82 virtual QVariant
data(
int i) = 0;
84 virtual bool reset(
const QString& sqlquery) = 0;
92 virtual QSqlRecord
record()
const;
97 virtual bool execBatch(
bool arrayBind =
false);
106 QSqlResultPrivate *d_ptr;
109 Q_DISABLE_COPY(QSqlResult)
QSize size() const
Returns the size of the image, without actually reading the image contents.
GLuint handle() const
Returns the OpenGL framebuffer object handle for this framebuffer object (returned by the {glGenFrame...
void setActive(bool newState)
Sets the active state of the paint engine to state.
bool isActive() const
Returns true if begin() has been called and end() has not yet been called; otherwise returns false.
virtual bool isValid() const
QSqlQueryPrivate(QSqlResult *result)
static QSqlQueryPrivate * shared_null()
The QSqlResult class provides an abstract interface for accessing data from specific SQL databases.
bool isForwardOnly() const
Returns true if you can only scroll forward through the result set; otherwise returns false.
virtual QVariant lastInsertId() const
Returns the object ID of the most recent inserted row if the database supports it.
QString executedQuery() const
Returns the query that was actually executed.
QSql::ParamType bindValueType(const QString &placeholder) const
This is an overloaded member function, provided for convenience. It differs from the above function o...
void clear()
Clears the entire result set and releases any associated resources.
virtual bool isNull(int i)=0
Returns true if the field at position index in the current row is null; otherwise returns false.
virtual bool execBatch(bool arrayBind=false)
virtual void virtual_hook(int id, void *data)
virtual void setNumericalPrecisionPolicy(QSql::NumericalPrecisionPolicy policy)
virtual void detachFromResultSet()
bool isPositionalBindingEnabled() const
int at() const
Returns the current (zero-based) row position of the result.
virtual bool fetchLast()=0
Positions the result to the last record (last row) in the result.
virtual bool prepare(const QString &query)
Prepares the given query for execution; the query will normally use placeholders so that it can be ex...
QVariant boundValue(const QString &placeholder) const
This is an overloaded member function, provided for convenience. It differs from the above function o...
virtual bool exec()
Executes the query, returning true if successful; otherwise returns false.
void setPositionalBindingEnabled(bool enable)
void addBindValue(const QVariant &val, QSql::ParamType type)
Binds the value val of parameter type paramType to the next available position in the current record ...
virtual QVariant data(int i)=0
Returns the data for field index in the current row as a QVariant.
friend class QSqlTableModelPrivate
virtual int numRowsAffected()=0
Returns the number of rows affected by the last query executed, or -1 if it cannot be determined or i...
bool isSelect() const
Returns true if the current result is from a SELECT statement; otherwise returns false.
virtual bool fetch(int i)=0
Positions the result to an arbitrary (zero-based) row index.
virtual void setAt(int at)
This function is provided for derived classes to set the internal (zero-based) row position to index.
virtual void setSelect(bool s)
This function is provided for derived classes to indicate whether or not the current statement is a S...
QString lastQuery() const
Returns the current SQL query text, or an empty string if there isn't one.
bool hasOutValues() const
Returns true if at least one of the query's bound values is a QSql::Out or a QSql::InOut; otherwise r...
virtual bool fetchPrevious()
Positions the result to the previous record (row) in the result.
virtual bool nextResult()
virtual bool reset(const QString &sqlquery)=0
Sets the result to use the SQL statement query for subsequent data retrieval.
QVariantList & boundValues(QT6_DECL_NEW_OVERLOAD)
virtual void bindValue(const QString &placeholder, const QVariant &val, QSql::ParamType type)
This is an overloaded member function, provided for convenience. It differs from the above function o...
virtual bool fetchNext()
Positions the result to the next available record (row) in the result.
void resetBindCount()
Resets the number of bind parameters.
virtual bool savePrepare(const QString &sqlquery)
Prepares the given query, using the underlying database functionality where possible.
QSqlError lastError() const
Returns the last error associated with the result.
QSql::NumericalPrecisionPolicy numericalPrecisionPolicy() const
QSql::ParamType bindValueType(int pos) const
Returns the parameter type for the value bound at position index.
virtual bool fetchFirst()=0
Positions the result to the first record (row 0) in the result.
virtual void setLastError(const QSqlError &e)
This function is provided for derived classes to set the last error to error.
QVariant boundValue(int pos) const
Returns the value bound at position index in the current record (row).
virtual QSqlRecord record() const
Returns the current record if the query is active; otherwise returns an empty QSqlRecord.
BindingSyntax bindingSyntax() const
Returns the binding syntax used by prepared queries.
int boundValueCount() const
Returns the number of bound values in the result.
virtual void setQuery(const QString &query)
Sets the current query for the result to query.
QString boundValueName(int pos) const
Returns the name of the bound value at position index in the current record (row).
QStringList boundValueNames() const
Returns the names of all bound values.
virtual void setForwardOnly(bool forward)
Sets forward only mode to forward.
virtual void bindValue(int pos, const QVariant &val, QSql::ParamType type)
Binds the value val of parameter type paramType to position index in the current record (row).
#define qCWarning(category,...)
#define Q_STATIC_LOGGING_CATEGORY(name,...)