microsoft / ODBC-Specification

Microsoft ODBC Specification
Other
122 stars 40 forks source link

SQLState(s) for breaking SQLNextColumn column restriction? #63

Open matthew-wozniczka opened 7 years ago

matthew-wozniczka commented 7 years ago

After SQLNextColumn returns a column number, you're generally only allowed to manipulate the column/parameter returned (until the interrupted fetch/execute completes).

What SQLState(s) will functions such as SQLBindCol, SQLSetDescField, SQLGetData, etc. emit if the application attempts to manipulate a different column?

matthew-wozniczka commented 7 years ago

On a related note, there should be a list of allowed functions during the 'intermediate fetch' state, and restrictions on them.

Which statement attributes can be changed?

For example, I assume that you would only be able to modify the ARD (not APD) during this state, in addition to being 'locked' to the column returned by SQLNextColumn

mikepizzo commented 7 years ago

Calling SQLBindCol, SQLSetDescField, SQLGetData, etc. to manipulate a different column should return 07009 Invalid descriptor index

Added to spec: The following operations are valid in a SQL_DATA_AVAILABLE state. For any other operations on a statement handle in the SQL_DATA_AVAILABLE case, the DM returns HY010, function sequence error.

*The Driver Manager returns SQLState 07009, Invalid descriptor index, if the application attempts to call SQLBindCol, SQLSetDescField, SQLSetDescRecord in the DATA_AVAILABLE case for a column other than the current column, or if SQLGetData or SQLGetNestedHandle is called and the driver does not support SQL_GD_ANY_ORDER.