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

Unable to pass a generator to executemany #12

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

Unable to pass a generator to executemany #12

svieira opened this issue Jul 27, 2012 · 5 comments
Assignees

Comments

@svieira
Copy link

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?

@mkleehammer
Copy link
Owner

In the generator branch. Waiting for testing on Windows.

@svieira
Copy link
Author

svieira commented Sep 27, 2012

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

@mkleehammer
Copy link
Owner

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

@mkleehammer
Copy link
Owner

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

@svieira
Copy link
Author

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
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants