-
Notifications
You must be signed in to change notification settings - Fork 83
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
No data results hides subsequent result sets. #43
Comments
Thank you so much for the awesome issue and information. Fixed in 918d73c :) |
From @mloskot on May 15, 2016 19:40 Since there is some related future work planned as per this point in the README: Refactor code to remove the need for the According ot the ODBC reference,
I don't exactly see how the code could be refactored to catter for such buggy drivers without some performance overhead/complexity increase (extra ODBC API calls). If anything needs to be done, it deserves a dedicated pull request/issue. |
Yeah, the workaround was provided to get nanodbc working with Vertica ODBC drivers. There probably isn't an easy way to automatically handle busted drivers like this without detecting them at runtime, and there's no reason to go down that road if the |
From @aquasync on December 30, 2014 0:48
I'm using nanodbc to run a chunk of sql containing multiple statements (dml/ddl along with selects), and iterating through the results with something like the following:
I ran into the situation where queries which return no data return a default-constructed result object, as the
SQL_NO_DATA
path inexecute
/execute_direct
is taken. This causes it to have no underlyingresult_impl
or reference to the statement, so you are unable to advance to subsequent result sets. Adding a preceding dummy query seems to fix this.For example, in
"select top 0 1 as a into #temp; select 2 as b"
, data from the latter select is not reachable, but prepending"select 1 as a into #dummy; "
returns a valid result object allowing you to iterate to the final result set.Commenting out the above-mentioned
SQL_NO_DATA
path in bothexecute
&execute_direct
fixes this for me by returning a valid result object always. Could this be deleted upstream or is it needed in some other situtation?Copied from original issue: lexicalunit/nanodbc#33
The text was updated successfully, but these errors were encountered: