StickManVS
StickManVS

Reputation: 3

Python SQlite3 Update function, sqlite3.OperationalError: near "WHERE": syntax error

I'm trying to update an item in my database for the relevant field which is identified by an OrderID.

 cursor.execute("UPDATE Customer_Orders SET Progress=?, WHERE OrderID=?", 
 ("Completed", tableOrderInfo[0],))

However, I keep getting this syntax error and I don't know why.

 sqlite3.OperationalError: near "WHERE": syntax error

Upvotes: 0

Views: 665

Answers (1)

Ashutosh Chapagain
Ashutosh Chapagain

Reputation: 926

UPDATE Customer_Orders SET Progress=? WHERE OrderID=?

remove the comma before WHERE.

See more about UPDATE in SQL here.

Upvotes: 1

Related Questions