SQL query setForwardOnly option
-
i use the same
QSqlQuery
instance object for executing several queries, all of which are forward-only.
is it enough to setsetForwardOnly(true)
before prepating/executing the first query, or i need to set it before each query? -
@user4592357 said in SQL query setForwardOnly option:
is it enough to set setForwardOnly(true) before prepating/executing the first query
Yes. If you're unsure try yourself and check if it is forwardOnly after you created the second query.
-
@Christian-Ehrlicher
thanks, and what about when i bind values to query and execute it and it fails, can i execute another query with same bound values without binding them again? -
As always - try it out. But as long as you don't call reset you should be safe. It's possible to bind only a subset of all bound values after each query so it should be the same for a failed one.