parameter unsupported when inserting int in sqlite

前端 未结 2 743
逝去的感伤
逝去的感伤 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:00

    changing that line with this

    cur.execute('insert into new_test (curent_dt) values (?)',str(temp))
    0 讨论(0)
  • 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.

    0 讨论(0)
提交回复
热议问题