我的程序引发sqlite3.OperationalError
异常并显示以下消息:
: near ",": syntax error
我有一个 try-except 块,可以打印我的 SQL 字符串。:
try:
self._db_cur.execute(sql)
except Exception, e:
print sql
raise e
这是打印出来的 SQL……最有趣的部分是……如果我在我的 SQLite 管理器中插入该查询……它确实可以工作。我在这里一无所知。
INSERT INTO connections_to_jjos(
connections_id,
jjo_error_id,
binder_task_id
)
VALUES
(
55,
(select id from jjo_errors where name = "--Unknown--"),
(select id from tasks where name = "DCDD")
)
,
(
55,
(select id from jjo_errors where name = "--Unknown--"),
(select id from tasks where name = "ANDD")
)
由于某些原因,我没有使用参数化语句,如果它有帮助的话......