问题
tst = dbConnection.execute("SELECT nameshort, namefull, timelastpostsecs, qtypostlasttime
FROM " + tableToUse + " WHERE compid = ?", (str(row['compid']),))
Give following error when run 3rd time in cycle where row
is different each time:
sqlite3.InterfaceError: Error binding parameter 0 - probably unsupported type.
Select is run right after update
- commit
to check update.
When I copy code from error message and execute it again in IDE Python (where I run script), it works w/out error.
What could it mean?
I understand I can add try
and then retry in case of exception, still maybe there is better way.
ADDED: added try:
and see that error persists at each cycle loop after 3rd update. After waiting 5 seconds and trying again select works. So kind of for this code (which is not time critical) issue is worked around. Still I'm interested if it's known issue with sqlite.
来源:https://stackoverflow.com/questions/38414530/python-sqlite3-cannot-select-right-after-update-commit-works-on-retry