Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
doc_src_sql-driver_snippet.cpp
Go to the documentation of this file.
1// Copyright (C) 2020 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
3//! [36]
6query.setForwardOnly(true);
7query.exec("SELECT * FROM table");
8while (query.next()) {
9 // Handle changes in every iteration of the loop
10 v = query.result()->handle();
11
12 if (qstrcmp(v.typeName(), "PGresult*") == 0) {
13 PGresult *handle = *static_cast<PGresult **>(v.data());
14 if (handle) {
15 // Do something...
16 }
17 }
18}
19//! [36]
QSqlQuery query
[36]