-
Notifications
You must be signed in to change notification settings - Fork 40
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SQLBindCol description & SQL_DATA_AT_FETCH #98
Comments
On that note, would it be possible to increase the scope of this repo to include the 'rest' of the spec? |
How does this interact with |
Proposal:
|
Alternatively, we could say that client sets the value referenced by str_len_or_indicator_ptr to any value other than SQL_DATA_AT_FETCH (typically SQL_DATA_UNAVAILABLE for the first fetch) and that the driver sets the value of unused bound columns (not those marked as SQL_DATA_AT_FETCH) to SQL_DATA_UNAVAILABLE. That would allow the client not to have to reset the status between each call to SQLFetch/SQLFetchScroll. |
"If DynamicColumns is true" == SQL_ATTR_DYNAMIC_COLUMNS is true? IIRC SQL_DATA_AT_FETCH is still supported even when dynamic columns are turned off, right? Will it only be supported when the ODBC version is set to 4+? Otherwise it could still break applications. |
No; you're right. SQL_DATA_AT_FETCH is supported even when dynamic columns is turned off; the driver just doesn't need to set DATA_UNAVAILABLE in those cases. SO I think what we're left with is that the 4.0 application must initialize the buffer to some value other than SQL_DATA_AT_FETCH. Typically this will be the value from the previous fetch, and applications can initialize it to SQL_DATA_UNAVAILABLE. |
Sorry, just want to be clear on this, is |
Correct. |
We could add a (statement?) option that the application set to enable data_at_fetch (SQL_STMT_ATTR_ENABLE_FETCH_I_PROMISE_TO_INITIALIZE_MY_STR_LEN_OR_IND_PTRS), but that would basically have the same effect as setting the version to 4.0 so might not be worth it... |
Not sure if it belongs in this issue, but another issue I have with the current definition of What I mean is that the driver actually has to look at the value for each cell, and check it against IMO it would be better if you had to specify it per-column, as opposed to per-cell. (Just off the top of my head, a new descriptor field, something like |
Agree that having a descriptor field for data-at-fetch addresses a lot of issues with overloading str_len_or_ind_ptr as an input/output field. This means that the application will have to set this outside of calling SQLBindCol, but that's probably fine. There is already a SQL_DESC_BIND_TYPE used for row-wise/column-wise binding. Proposal:
|
Applied. |
Need to add to headers: SQL_DESC_DATA_AT_FETCH. |
The current description of
SQLBindCol
on MSDN talks about the valid values forStrLen_or_IndPtr
, and says thatSQLFetch
/SQLFetchScroll
return values into that buffer, but for theSQL_DATA_AT_FETCH
case it will be using it for input, so that description will need to be changed.The text was updated successfully, but these errors were encountered: