l******9 发帖数: 579 | 1 I am working on pyodbc in Eclipse (4.3.2v20140221-1852) with PyDev on Win 7.
My python is 3.2.5.
At my code:
cursor.execute("select top " + str(1) + " a.my_id, a.mycode" +
"from my_table as a where a.mycode = ?", aGivenCode)
I got an error :
pyodbc.ProgrammingError: ('42000', "[42000] [Microsoft][ODBC SQL Server
Driver]
[SQL Server]Incorrect syntax near the keyword 'as'. (156) (SQLExecDirectW)")
Why I got error at " as a " ?
thanks ! | k*****n 发帖数: 117 | 2 try remvoing 'as':
cursor.execute("select top " + str(1) + " a.my_id, a.mycode" +
"from my_table a where a.mycode = ?", aGivenCode) |
|