Closed GoogleCodeExporter closed 9 years ago
Not a very good error message, but it is because you are passing more parameter
values than parameters in the SQL. You need '?' markers in your SQL for where
you want the parameters to go. Cursor.execute is generic and is not just for
stored procedures.
You can see an example of this in the sqlservertests.py test_sp_with_none. You
want something like this:
cursor.execute("{call proc_name(?)", params)
or
cursor.execute("{call proc_name(?)", value1, value2, ...)
This is the ODBC escape syntax that should work for any database. (The driver
is responsible for converting it to the DB's specific syntax.):
http://msdn.microsoft.com/en-us/library/ms710100(v=vs.85).aspx
You can also use your DB's syntax directly. For SQL Server you can use:
cursor.execute("exec proc_name ?", params)
Original comment by mkleehammer
on 13 Sep 2011 at 10:36
Original issue reported on code.google.com by
chandij....@gmail.com
on 6 Sep 2011 at 5:58Attachments: