Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Unable to pass a generator to executemany #12

Closed
svieira opened this Issue Jul 27, 2012 · 5 comments

Comments

Projects
None yet
2 participants

svieira commented Jul 27, 2012

I'm using Pyodbc 3.0.3.

Attempting to use the following code:

connection.cursor().executemany("INSERT INTO my_table (AN_INT) VALUES(?)",
     ((id_, ) for id_ in xrange(1000)))

results in a ProgrammingError - pyodbc is checking the the result is a sequence of the type Tuple, List or Row. Would it be possible to also add generators to the list of valid sequences that can be passed to this method?

@ghost ghost assigned mkleehammer Sep 27, 2012

@mkleehammer mkleehammer reopened this Sep 27, 2012

Owner

mkleehammer commented Sep 27, 2012

In the generator branch. Waiting for testing on Windows.

svieira commented Sep 27, 2012

@mkleehammer - I have confirmed that it is now working on Windows. Thank you very much!

Owner

mkleehammer commented Sep 27, 2012

Wow. Thanks. I meant that I was going to test on Windows, as soon as my new Windows VirtualBox VM is setup. Thanks, though!

Owner

mkleehammer commented Sep 27, 2012

My last comment didn't come out right: I was going to test on Windows, but thanks for beating me too it!

svieira commented Sep 27, 2012

😁 - Glad I could help!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment