PDA

View Full Version : How to delete results of QSqlQuery from table ?



homerun4711
14th February 2011, 17:56
Hello!

Usually I take the normal way to delete stuff from a database:


DELETE FROM BooksTemp WHERE id = 1;

But is there another way to delete the results of a QSqlQuery from the underlying SQL table, e.g. to query for stuff, do something to the data and remove it afterwards?

Something like


QSqlQuery::deleteFromTable();

Kind regards,
HomeR

ChrisW67
14th February 2011, 23:35
What's wrong with the "normal" way using the same SQL where clause?

homerun4711
14th February 2011, 23:50
What's wrong with the "normal" way using the same SQL where clause?

Nothing at all, I just want to know if such a function exists.