0
我正在用此代碼檢查給定的transactionid是否存在於我的sqlite數據庫中。sqlite3.InterfaceError的其他原因:錯誤綁定參數0 - 可能不受支持的類型
print((transaction.transactionid,))
print(type(transaction.transactionid))
c.execute("SELECT EXISTS(SELECT transactionid FROM Transactions WHERE transactionid=?);",
(transaction.transactionid,))
self.dbconn.commit()
transaction_exists, = c.fetchone()
print(transaction_exists)
它總是失敗,出現此錯誤的第二次迭代:
File "RtMetaMaster.py", line 182, in sync_ticket_to_db (transaction.transactionid,)) sqlite3.InterfaceError: Error binding parameter 0 - probably unsupported type.
輸出的打印語句:
('626007',)
<class 'str'>
0
('625952',)
<class 'str'>
Traceback (most recent call last):
[..]
File "RtMetaMaster.py", line 182, in sync_ticket_to_db
(transaction.transactionid,))
sqlite3.InterfaceError: Error binding parameter 0 - probably unsupported type.
兩個倍的transactionId是類型類的「海峽」,但它不知何故第二次失敗。還有哪些錯誤會導致「錯誤綁定參數」?