Bobspadger / pyodbc

Automatically exported from code.google.com/p/pyodbc
MIT No Attribution
0 stars 0 forks source link

Issue with executing query #74

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
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.

Original issue reported on code.google.com by sucking....@gmail.com on 27 Oct 2009 at 10:18

GoogleCodeExporter commented 9 years ago
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

Original comment by mkleehammer on 27 Oct 2009 at 1:30

GoogleCodeExporter commented 9 years ago
Need more information, so closing as invalid for now.  Reopen if you need to.

Original comment by mkleehammer on 31 Dec 2009 at 6:43

GoogleCodeExporter commented 9 years ago

Original comment by mkleehammer on 21 Nov 2010 at 4:43