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 #if QT_VERSION < 0x060000
34 static QString formatValue(
const QVariant &val,
QVariant::Type type,
const QSqlDatabase &database);
35 static QString formatValue(
const QVariant &val,
QVariant::Type type,
const QSqlDriver *driver);
37 static QString formatValue(
const QVariant &val,
const QMetaType &type,
int databaseId = 0);
38 static QString formatValue(
const QVariant &val,
const QMetaType &type,
const QSqlDatabase &database);
39 static QString formatValue(
const QVariant &val,
const QMetaType &type,
const QSqlDriver *driver);
41 static QString formatValue(
const QVariant &val,
const QSqlDriver *driver);
42 static QString
formatValue(
const QVariant &val,
const QSqlDatabase &database) {
return formatValue(val, database.driver()); }
45 QString _connectionName;
46 QVariantList _boundValues;
52 return (
next()) ? record().value(0) : QVariant();
58 return QSqlQuery::numRowsAffected();
64 return QSqlQuery::size();
70 return QSqlQuery::next();
76 return QSqlQuery::value(index);
82 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:74
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:56
QVariant getNextValue()
Returns the value of first field in the next object and advances the internal iterator by one positio...
Definition: tsqlquery.h:50
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:62
static QString formatValue(const QVariant &val, const QSqlDatabase &database)
Definition: tsqlquery.h:42
bool next()
Retrieves the next record in the result, if available, and positions the query on the retrieved recor...
Definition: tsqlquery.h:68
@ Type
Definition: tfnamespace.h:330
@ Invalid
Definition: tfnamespace.h:22
#define T_CORE_EXPORT
Definition: tdeclexport.h:28