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?
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.
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.