12 bool load(
const QString &filename);
14 TSqlQuery &bind(
const QString &placeholder,
const QVariant &val);
15 TSqlQuery &bind(
int pos,
const QVariant &val);
17 QVariant boundValue(
int pos)
const;
18 QVariantList boundValues()
const;
19 QVariant getNextValue();
20 QString queryDirPath()
const;
21 bool exec(
const QString &query);
23 int numRowsAffected()
const;
26 QVariant value(
int index)
const;
27 QVariant value(
const QString &name)
const;
29 static void clearCachedQueries();
30 static QString escapeIdentifier(
const QString &identifier, QSqlDriver::IdentifierType type = QSqlDriver::FieldName,
int databaseId = 0);
31 static QString escapeIdentifier(
const QString &identifier, QSqlDriver::IdentifierType type,
const QSqlDriver *driver);
32 static QString formatValue(
const QVariant &val,
const QMetaType &type,
int databaseId = 0);
33 static QString formatValue(
const QVariant &val,
const QMetaType &type,
const QSqlDatabase &database);
34 static QString formatValue(
const QVariant &val,
const QMetaType &type,
const QSqlDriver *driver);
35 static QString formatValue(
const QVariant &val,
const QSqlDriver *driver);
36 static QString
formatValue(
const QVariant &val,
const QSqlDatabase &database) {
return formatValue(val, database.driver()); }
39 QString _connectionName;
40 QVariantList _boundValues;
46 return (
next()) ? record().value(0) : QVariant();
52 return QSqlQuery::numRowsAffected();
58 return QSqlQuery::size();
64 return QSqlQuery::next();
70 return QSqlQuery::value(index);
76 return QSqlQuery::value(name);
The TSqlQuery class provides a means of executing and manipulating SQL statements.
Definition tsqlquery.h:6
QVariant value(int index) const
Returns the value of field index in the current record.
Definition tsqlquery.h:68
int numRowsAffected() const
Returns the number of rows affected by the result's SQL statement, or -1 if it cannot be determined.
Definition tsqlquery.h:50
QVariant getNextValue()
Returns the value of first field in the next object and advances the internal iterator by one positio...
Definition tsqlquery.h:44
bool loadPreparedQuery(const QString &filename)
Definition tsqlquery.h:13
int size() const
Returns the size of the result (number of rows returned), or -1 if the size cannot be determined or i...
Definition tsqlquery.h:56
static QString formatValue(const QVariant &val, const QSqlDatabase &database)
Definition tsqlquery.h:36
bool next()
Retrieves the next record in the result, if available, and positions the query on the retrieved recor...
Definition tsqlquery.h:62
#define T_CORE_EXPORT
Definition tdeclexport.h:28