我正在使用 python 并尝试按如下方式插入到 sqlite3 表中:
database.execute("INSERT INTO EXAMPLE VALUES (?, ?, DATETIME('now','+? seconds'), ?);", (id, statement, time_duration, access))
我得到以下异常:
ProgrammingError: Incorrect number of bindings supplied. The current statement uses 3, and there are 4 supplied.
我相信这是因为出于某种原因,查询参数绑定在DATETIME('now','+? seconds);
. 如果我在查询中硬编码 +60 秒左右,这很好用。
有没有办法让 sqlite3 在那里插入提供的绑定?
梵蒂冈之花
相关分类