- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files
- Directories
- Examples

- Class List
- Class Hierarchy
- Class Members

Public Types | Public Member Functions

# QSqlQuery Class Reference

Search for all occurrences

## Detailed Description

Definition at line 63 of file qsqlquery.h.

`#include <qsqlquery.h>`

List of all members.

## Public Types
enum | BatchExecutionMode { ValuesAsRows, ValuesAsColumns }
## Public Member Functions
| QSqlQuery (QSqlResult *r)
| QSqlQuery (const QString &query=QString(), QSqlDatabase db=QSqlDatabase())
| QSqlQuery (QSqlDatabase db)
| QSqlQuery (const QSqlQuery &other)
QSqlQuery & | operator= (const QSqlQuery &other)
| ~QSqlQuery ()
bool | isValid () const
bool | isActive () const
bool | isNull (int field) const
int | at () const
QString | lastQuery () const
int | numRowsAffected () const
QSqlError | lastError () const
bool | isSelect () const
int | size () const
const QSqlDriver * | driver () const
const QSqlResult * | result () const
bool | isForwardOnly () const
QSqlRecord | record () const
void | setForwardOnly (bool forward)
bool | exec (const QString &query)
QVariant | value (int i) const
void | setNumericalPrecisionPolicy (QSql::NumericalPrecisionPolicy precisionPolicy)
QSql::NumericalPrecisionPolicy | numericalPrecisionPolicy () const
bool | seek (int i, bool relative=false)
bool | next ()
bool | previous ()
bool | first ()
bool | last ()
void | clear ()
bool | exec ()
bool | execBatch (BatchExecutionMode mode=ValuesAsRows)
bool | prepare (const QString &query)
void | bindValue (const QString &placeholder, const QVariant &val, QSql::ParamType type=QSql::In)
void | bindValue (int pos, const QVariant &val, QSql::ParamType type=QSql::In)
void | addBindValue (const QVariant &val, QSql::ParamType type=QSql::In)
QVariant | boundValue (const QString &placeholder) const
QVariant | boundValue (int pos) const
QMap< QString, QVariant > | boundValues () const
QString | executedQuery () const
QVariant | lastInsertId () const
void | finish ()
bool | nextResult ()

## Member Enumeration Documentation

enum BatchExecutionMode

Search for all occurrences

Enumerator:

  ValuesAsRows | Search for all occurrences
  ValuesAsColumns | Search for all occurrences

Definition at line 107 of file qsqlquery.h.

    { ValuesAsRows, ValuesAsColumns };

## Constructor & Destructor Documentation

QSqlQuery | ( | QSqlResult * | r | ) |

QSqlQuery | ( | const QString & | query = `QString()`,
|  | QSqlDatabase | db = `QSqlDatabase()`
| ) |  |

QSqlQuery | ( | QSqlDatabase | db | ) | `[explicit]`

QSqlQuery | ( | const QSqlQuery & | other | ) |

~QSqlQuery | ( |  | ) |

## Member Function Documentation

QSqlQuery& operator= | ( | const QSqlQuery & | other | ) |

bool isValid | ( |  | ) | const

Search for all occurrences

bool isActive | ( |  | ) | const

Search for all occurrences

bool isNull | ( | int | field | ) | const

Search for all occurrences

int at | ( |  | ) | const

Search for all occurrences

QString lastQuery | ( |  | ) | const

Search for all occurrences

int numRowsAffected | ( |  | ) | const

Search for all occurrences

QSqlError lastError | ( |  | ) | const

Search for all occurrences

bool isSelect | ( |  | ) | const

Search for all occurrences

int size | ( |  | ) | const

Search for all occurrences

const QSqlDriver* driver | ( |  | ) | const

Search for all occurrences

const QSqlResult* result | ( |  | ) | const

Search for all occurrences

bool isForwardOnly | ( |  | ) | const

Search for all occurrences

QSqlRecord record | ( |  | ) | const

Search for all occurrences

void setForwardOnly | ( | bool | forward | ) |

Search for all occurrences

bool exec | ( | const QString & | query | ) |

Search for all occurrences

QVariant value | ( | int | i | ) | const

Search for all occurrences

void setNumericalPrecisionPolicy | ( | QSql::NumericalPrecisionPolicy | precisionPolicy | ) |

Search for all occurrences

QSql::NumericalPrecisionPolicy numericalPrecisionPolicy | ( |  | ) | const

Search for all occurrences

bool seek | ( | int | i,
|  | bool | relative = `false`
| ) |  |

Search for all occurrences

bool next | ( |  | ) |

Search for all occurrences

bool previous | ( |  | ) |

Search for all occurrences

bool first | ( |  | ) |

Search for all occurrences

bool last | ( |  | ) |

Search for all occurrences

void clear | ( |  | ) |

Search for all occurrences

bool exec | ( |  | ) |

Search for all occurrences

bool execBatch | ( | BatchExecutionMode | mode = `ValuesAsRows` | ) |

Search for all occurrences

bool prepare | ( | const QString & | query | ) |

Search for all occurrences

void bindValue | ( | const QString & | placeholder,
|  | const QVariant & | val,
|  | QSql::ParamType | type = `QSql::In`
| ) |  |

Search for all occurrences

void bindValue | ( | int | pos,
|  | const QVariant & | val,
|  | QSql::ParamType | type = `QSql::In`
| ) |  |

Search for all occurrences

void addBindValue | ( | const QVariant & | val,
|  | QSql::ParamType | type = `QSql::In`
| ) |  |

Search for all occurrences

QVariant boundValue | ( | const QString & | placeholder | ) | const

Search for all occurrences

QVariant boundValue | ( | int | pos | ) | const

Search for all occurrences

QMap<QString, QVariant> boundValues | ( |  | ) | const

Search for all occurrences

QString executedQuery | ( |  | ) | const

Search for all occurrences

QVariant lastInsertId | ( |  | ) | const

Search for all occurrences

void finish | ( |  | ) |

Search for all occurrences

bool nextResult | ( |  | ) |

Search for all occurrences

The documentation for this class was generated from the following file:

- QtSql/qsqlquery.h

QSqlQuery QSqlQuery QSqlQuery QSqlQuery QSqlQuery QSqlQuery QSqlQuery QSqlQuery QSqlQuery QSqlQuery
QSqlQuery QSqlQuery QSqlQuery QSqlQuery QSqlQuery QSqlQuery QSqlQuery QSqlQuery QSqlQuery QSqlQuery