3

I am using python 2.7 for a specific job. I am connecting to MSSQL Server (2008) using FreeTDS. I can make some simple select queries but when I try to run a parametrised query I got an error:

('HY004', '[HY004] [FreeTDS][SQL Server]Invalid data type (0) (SQLBindParameter)')

Here is my query:

query = u"UPDATE table SET column1=? WHERE column2=?"
cursor.execute(query,[param1, param2])

However the same code on live works fine.

I have skimmed so many thread in various forums but they all seem misleading and I am really confused.

What is my actual problem and what do you suggest?

Edit: I've added query.

4

1 に答える 1