Python 无法使用pyodbc更新sql数据库表中的多个cloum

Python 无法使用pyodbc更新sql数据库表中的多个cloum,python,sql,raspberry-pi,pyodbc,Python,Sql,Raspberry Pi,Pyodbc,我目前正在做一个学校项目。我需要更新表中的GPS坐标。我正在使用Raspberry pi板、pyodbc、freeTds和sql数据库。我无法更新一行中的多个项目 cursor.execute("update Gps_table set longitude=(?) latitude=(?) where gps_id=1", s1, s2) 上述代码不起作用。。但我已经弄明白了,当我一次只传递一个变量时,它就工作了。这意味着下面的代码正在工作 cursor.execute("update Gps

我目前正在做一个学校项目。我需要更新表中的GPS坐标。我正在使用Raspberry pi板、pyodbc、freeTds和sql数据库。我无法更新一行中的多个项目

cursor.execute("update Gps_table set longitude=(?) latitude=(?) where gps_id=1", s1, s2)
上述代码不起作用。。但我已经弄明白了,当我一次只传递一个变量时,它就工作了。这意味着下面的代码正在工作

cursor.execute("update Gps_table set longitude=(?) where gps_id=1", s1)
cursor.execute("update Gps_table set latitude=(?) where gps_id=1", s2)
但我需要立即更新这两个参数。谁能帮我一下吗。感谢您阅读此..

请参阅:

cursor.execute("update Gps_table set longitude=?,latitude=? where gps_id=1", s1, s2)