gpt4 book ai didi

python - 错误 : Cursor' object has no attribute '_last_executed

转载 作者:太空狗 更新时间:2023-10-29 18:23:26 24 4
gpt4 key购买 nike

我有这个光标

cursor.execute("SELECT price FROM Items WHERE itemID = ( 
SELECT item_id FROM Purchases
WHERE purchaseID = %d AND customer_id = %d)",
[self.purchaseID, self.customer])

我收到这个错误

'Cursor' object has no attribute '_last_executed'

但是当我尝试这个时:

cursor.execute("SELECT price FROM Items WHERE itemID = ( 
SELECT item_id FROM Purchases
WHERE purchaseID = 1 AND customer_id = 1)",
)

没有错误。我该如何解决这个问题?

最佳答案

我也遇到过这个问题。我把%d改成了%s,就解决了。希望这对你有用。

关于python - 错误 : Cursor' object has no attribute '_last_executed,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12692043/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com