| Issue 74: | Issue with executing query | |
| 2 people starred this issue and may be notified of changes. | Back to list |
When trying to submit a python dictionary which is nested inside a list, I get the following error: The first argument to execute must be a string or unicode query. I use the latest pyodbc pre-compiled version for python 2.6.2 on Win7. MySQL came with the current xampp-package and uses default settings.
Dec 31, 2009
Need more information, so closing as invalid for now. Reopen if you need to.
Status:
Invalid
Nov 21, 2010
(No comment was entered for this change.)
Status:
NoFix
|
Two things: (1) The error message is saying that the first argument must be the actual SQL and it must be a string or Unicode value: cursor.execute("select * from x"). The error is saying you passed something else. (2) pyodbc only supports a SQL interface -- you won't be able to pass dictionaries, etc. Are you sure you are using the right product? You might be looking for something like SQLObject or something. If you still think there is a pyodbc problem, past a bit of the code here so we can see. Also, for help from lots of people, you might find the pyodbc discussion group handy: http://groups.google.com/group/pyodbc