这是我的Python代码-
cursor.execute("""UPDATE tasks SET task_owner=%s,task_remaining_hours=%s, task_impediments=%s,task_notes=%s WHERE task_id=%s""", (new_task_owner,new_task_remaining_hours,new_task_impediments,
new_task_notes,task_id))
这是我在SQLite3管理器(Firefox扩展)中尝试的SQL语句
UPDATE tasks SET task_owner=%s,task_remaining_hours=%d,task_impediments=%s,task_notes=%s WHERE task_id=%d,("sumod",10,"none","test",1)
我得到的错误是-
sqlite3.OperationalError: near "%": syntax error
我尝试过很多网络搜索,包括SO、教程和自我故障排除,但这个错误并没有消失。我到底做错了什么。
也可以使用%s:
我相信Python的SQLite实现使用
?
占位符,这与MySQLdb的%s
不同。Review the documentation.相关问题 更多 >
编程相关推荐