Reputation: 2528
I'm wondering does QtSql + Sqlite support QSqlQuery::size() function?
Upvotes: 5
Views: 5733
Reputation: 1515
I also faced the same issue with SQLite and Qt.
As a solution I used
if (query.next())
{
}
to identify the query returns values or not.
But be careful it directs you to the first record. And if you need the no of records exactly, then this is not a solution.
Upvotes: 0
Reputation: 133
No, it doesn't. However, you can use last() and at() together to get the result.
QSqlQuery q;
q.exec("select * from table");
q.last();
qDebug() << q.at() + 1;
Upvotes: 10