microsoft / ODBC-Specification

Microsoft ODBC Specification
Other
121 stars 40 forks source link

'pre-binding' dynamic columns? #102

Open matthew-wozniczka opened 7 years ago

matthew-wozniczka commented 7 years ago

If the application binds column N + 1 (with the cursor currently having N columns), and a fetch is about to be interrupted because a new column was found (Let's assume SQL_ATTR_TYPE_EXCEPTION_BEHAVIOR is not SQL_TE_REPORT_ALL, I assume that would apply here), should the driver simply use that binding instead of returning SQL_DATA_AVAILABLE?

mikepizzo commented 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.

mikepizzo commented 7 years ago

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.

mikepizzo commented 7 years ago

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.