microsoft / ODBC-Specification

Microsoft ODBC Specification
Other
121 stars 40 forks source link

Error when binding a dynamic column w/o length-indicator? #105

Closed matthew-wozniczka closed 7 years ago

matthew-wozniczka commented 7 years ago

What happens if you bind a dynamic column without a length-indicator, and then fetch, and that column is not present for one of the rows of the fetched rowset? I was thinking it should behave similarly to if the value was NULL and there was no length-indicator bound (i.e. an error).

mikepizzo commented 7 years ago

Agree.

mikepizzo commented 7 years ago

Added to 3.9.4.1, Retrieving Dynamic Columns:

Once discovered, dynamic columns can be bound like any other column. If a bound dynamic column does not exist for a row, the driver sets its str_len_or_indicator_ptr to SQL_DATA_UNAVAILABLE. If str_len_or_indicator_ptr is null for a dynamic column that doesn't exist for the current row, SQLFetch, SQLFetchScroll, or SQLNextColumn returns an error (22002, Indicator variable required but not supplied).