Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
QSqlQuery get response
how can I get an answer to a query was successful?
If there is an error I can clear query.lastError (). Text (), but if the query is correct as I get an answer, for example, that tells me the number of changed lines or if the table was created?
mcosta last edited by mcosta
Hi and welcome to devnet,
you can use QSqlQuery::numRowsAffected for UPDATE statements.
For table creation you can check the error.
I try with DELETE and UPDATE, the tables are changed but the function return -1.
mcosta last edited by
Which driver are you using?
As stated in the documentation not all drivers support this feature. Check with
QSqlDriver::hasFeature()if is available for your driver
I use QPSQL. now try to check.
Thanks for now.