Details
-
Suggestion
-
Resolution: Unresolved
-
P3: Somewhat important
-
4.6.3
-
None
Description
It is impossible to access many of the features in the ODBC API with the current implementation, for example when using the ODBC driver and needing to set the ODBC statement attribute SQL_ATTR_CURSOR_SENSITIVITY to implement a dynaset then this is not possible.
Considering the richness of the ODBC API, in particular control over cursor attributes, setForwardOnly() is very limiting (this is the only cursor option exposed via QSqlQuery). What's worse is that while the ODBC statement handle is available via QSqlResult::handle() the implementation of QODBC resets the statement handle prior to executing every query which makes it useless for setting attributes prior to executing a query. It is thus impossible to access many of these features in the ODBC API with the current implementation.
While it is possible to write a custom driver, it is not possible to get this option through the QSqlQuery interface. What's needed is a hook like QSqlQuery::setUserData(const quint32 id, const QVariant& data) where the variants are simply stored in a hash and can be picked up in the driver implementation.