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

Cannot bind a parameter as SQL_INPUT_OUTPUT with data at execution #5

Open
lee-houghton opened this issue Sep 8, 2014 · 0 comments
Assignees
Labels

Comments

@lee-houghton
Copy link
Collaborator

http://msdn.microsoft.com/en-us/library/ms710963(v=vs.85).aspx

The problem is that in most cases of data at execution, the application is allowed to store a pointer value which identifies the parameter to be supplied (in our case, the Parameter object). This is passed instead of the buffer since a DAE SQL_PARAM_INPUT or SQL_PARAM_INPUT_STREAM doesn't need a bound output buffer.

In this case, however, the pointer value stored must be a pointer to the output buffer itself, not the Parameter object, as the driver needs the address of the output buffer.

We can't even search through all the bound parameters (this->bindings_) and find the parameter with a matching buffer because SQLParamData doesn't tell us what type of parameter is needed. The only way I can think to get around it is to actually store the parameter number (rather than a pointer) for all other parameter types and assume that tokens less than SHRT_MAX are parameter numbers and all other values are bound output buffers to search through bindings_ for.

@lee-houghton lee-houghton self-assigned this Sep 8, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant