12
Đây là mã Python của tôi -Sqlite3 - Cập nhật bảng sử dụng mã Python - Lỗi cú pháp gần% s
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))
Đây là câu lệnh SQL tôi cố gắng trong quản lý SQLite3 (Firefox extension)
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)
Lỗi tôi nhận được là -
sqlite3.OperationalError: near "%": syntax error
Tôi đã thử nhiều tìm kiếm trên web bao gồm SO, hướng dẫn và tự gỡ rối nhưng điều này lỗi không biến mất. Chính xác thì tôi đang làm sai ở đây.
Cảm ơn! Điều đó hoạt động rất tốt. – Sumod