Skip to content
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

SQLGetData called on bound columns regardless of SQL_GD_BOUND #13

Open
ghost opened this issue Oct 22, 2013 · 2 comments
Open

SQLGetData called on bound columns regardless of SQL_GD_BOUND #13

ghost opened this issue Oct 22, 2013 · 2 comments

Comments

@ghost
Copy link

ghost commented Oct 22, 2013

For fields exceeding the buffer size, SQLGetData is used to retrieve the data with multiple fetches. At this point the columns are already bound, which generates an error with drivers without SQL_GD_BOUND.

"If the driver does not support extensions to SQLGetData, the function can return data only for unbound columns with a number greater than that of the last bound column." - http://msdn.microsoft.com/en-us/library/ms715441%28v=vs.85%29.aspx

@zenzike
Copy link
Member

zenzike commented Oct 22, 2013

Thanks for reporting this! I'd be very happy to receive a patch if you have one to fix this.

@ghost
Copy link
Author

ghost commented Oct 22, 2013

Sorry, but I don't have a fix available. I'm using SQLSetStmtAttr
to set SQL_ATTR_MAX_LENGTH to colBufSizeDefault to truncate these
fields to the size of the buffer and avoid the error (Invalid descriptor index), but it's
just a workaround (currently I have no way of retrieving all the data).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant