| Issue 142: | nextset produces confusing results when resultsets are interleaved with other actions | |
| 4 people starred this issue and may be notified of changes. | Back to list |
[Copied from http://groups.google.com/group/pyodbc/msg/3eb36b0d94faecff] We have a pair of selects, possibly separated by something which is not a select. The pattern might be: SELECT INSERT SELECT; or SELECT RAISERROR SELECT; or SELECT PRINT SELECT. An additional complication is whether SET NOCOUNT is ON or not. In short, a rowcount-producing INSERT/UPDATE between SELECTs produces "No results. Previous SQL was not a query" while a RAISERROR between SELECTs produces "Error: ('HY000', 'The driver did not supply an error!')"; a PRINT between SELECTs likewise gives the "No results" message. This is against a pyodbc.pyd built from a fresh git clone. Example code at: http://python.pastebin.com/g4fh4z5A
Dec 5, 2010
Project Member
#1
mkleehammer
Status:
Accepted
Nov 4, 2011
After Cursor_nextset calls SQLMoreResults, I think it should check for !SQL_SUCCEEDED(ret) before SQL_NO_DATA (as it does in execute). |