parameter unsupported when inserting int in sqlite

前端 未结 2 757
逝去的感伤
逝去的感伤 2020-11-30 04:20

I have been going around and around with storing date and time in SQLite3 with the intention of retrieving the records using comparisons later e.g. SELECT * WHERE date

2条回答
  •  既然无缘
    2020-11-30 05:07

    Note the added comma after "temp" below:

    cur.execute('insert into new_test (curent_dt) values (?)', (temp,))
    

    The reason this happens is that (temp) is an integer but (temp,) is a tuple of length one containing temp.

提交回复
热议问题