Open matthew-wozniczka opened 7 years ago
Yes; the driver should use whatever bindings are available at the time it is performing the fetch. We do say that the application cannot change binding information for columns other than the "current" column, but if the application binds more columns than are described, those bindings should be used at fetch.
Check: does the Driver manager allow binding more columns than currently described by the descriptor?
Note: it probably makes sense to make this ability dependent upon the setting of SQL_ATTR_DYNAMIC_COLUMN; if dynamic columns are supported then DM should not restrict the set of bindings, otherwise it should continue to support any existing restrictions.
Spec calls out SQLState 07009, Invalid descriptor index, with the condition "The value specified for the argument ColumnNumber exceeded the maximum number of columns in the result set."
Not sure if DM enforces this currently or not.
If the application binds column
N + 1
(with the cursor currently havingN
columns), and a fetch is about to be interrupted because a new column was found (Let's assumeSQL_ATTR_TYPE_EXCEPTION_BEHAVIOR
is notSQL_TE_REPORT_ALL
, I assume that would apply here), should the driver simply use that binding instead of returningSQL_DATA_AVAILABLE
?