Skip to content
Advertisement

How to update an integer value in an SQL record?

I’m pretty new to SQL and the Sqlite3 module and I want to edit the timestamps of all the records in my DB randomly.

When run, I get a ValueError: parameters are of unsupported type.

To add the timestamp value originally I set t to a tuple and the current UNIX timestamp as the first value of a it e.g (1537828957, ). Is this error displaying because I’ve used two (?) unlike the single one I used in the statement to add the timestamps to begin with?

Advertisement

Answer

You’re using executemany instead of execute. executemany takes an iterator of tuples and executes the query for each tuple.

You want to use execute instead, it executes the query once using your tuple.

User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement