Reputation: 13
I am using the below code to delete a row from sqlite table.
def deleteFromTable(item):
conn = sqlite3.connect("lite.db")
cur = conn.cursor()
cur.execute("DELETE FROM store WHERE item=?", (item,))
conn.commit()
conn.close()
Why do i need to use comma after item (item,) while passing the argument?
Upvotes: 0
Views: 33
Reputation: 1434
('String')
evaluates into string, but ('string',)
evaluates into tuple. that's why you need comma.
Upvotes: 1