My programme raises an sqlite3.OperationalError exception with the following message:
: near ",": syntax error
I have a try-except block that prints me the SQL string.:
try:
self._db_cur.execute(sql)
except Exception, e:
print sql
raise e
This is the printed SQL... the most interesting part is... that if I insert that query in my SQLite manager... it DOES work. I'm clueless here.
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")
)
For some reasons, I am not using parameterized statements, if it helps...
VALUES->(->expr->)->,->(->exp->)->,... BUT I just googled multiples values in SQLite, and apparently it is not a valid statement. There are workarounds, though..executemany()instead.