错误:Cursor'对象没有属性'_last_executed [英] Error: Cursor' object has no attribute '_last_executed

查看:588
本文介绍了错误:Cursor'对象没有属性'_last_executed的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有这个游标

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)", 
                  )

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

there is no error. How do I fix this?

推荐答案

我也遇到了这个问题。我改变了%d到%s,它被解决。希望这对您有用。

I encountered this problem too. I changed the %d to %s, and it is solved. Wish this is useful for you.

这篇关于错误:Cursor'对象没有属性'_last_executed的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆