My favorites | Sign in
Project Home Downloads Wiki
READ-ONLY: This project has been archived. For more information see this post.
Search
for
  Advanced search   Search tips   Subscriptions
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
Status:  Accepted
Owner:  ----


 
Reported by tjgolden@gmail.com, Dec 1, 2010
[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
(No comment was entered for this change.)
Status: Accepted
Nov 4, 2011
#2 jeremy.eric.woo
After Cursor_nextset calls SQLMoreResults, I think it should check for !SQL_SUCCEEDED(ret) before SQL_NO_DATA (as it does in execute). 

Powered by Google Project Hosting