2

i am new to coding and try to update a field in a sqlite db, but i ran into an error which i dont understand.

sql_update_query = """Update assets set lastdatechecked = ? """
data = 'HELLO'
cursorObj.execute(sql_update_query, data,)
con.commit()

This is throwing an error: sqlite3.ProgrammingError: Incorrect number of bindings supplied. The current statement uses 1, and there are 5 supplied.

But why? 'Hello' is a single string, why is it counting the letters?

GÖRSTNE
  • 21
  • 2

1 Answers1

3

You have to provide data as a tuple: (data,)

peak
  • 105,803
  • 17
  • 152
  • 177