I'm trying to figure out what is the proper way to use prepared statements with QSqlQuery. The docs are not very specific on this subject.
So will this snippet create a permanent prepared statement in the connection database? Will this prepared statement persist between calls to select(), i.e. will it be saved when the function returns and QSqlQuery query is disposed?Qt Code:
query.prepare("SELECT * FROM theUniverse WHERE planet = :planet"); query.bindValue(":planet", "earth"); query.exec(); }To copy to clipboard, switch view to plain text mode
Or should I create QSqlQuery on the heap and use the same instance over and over again?
Bookmarks