我试图找到一种方法,如果我的光标返回行或不。
我确信我的数据库里有一条记录。但做了之后
if tcursor.fetchone():
它不返回任何行。如果我复制行,我的代码正在执行。为什么
sql = 'select Id, Delivery,FileName from [dbo].[SEDeliveryTemp] where
UpdateFlag=0 and TankSystemId =' \
+ str(TankSystemId) + ' and Date ='+"'" + str(date)+"'"
tcursor.execute(sql)
if tcursor.fetchone():
for (Id, Delivery, FileName) in tcursor:
print 'A' <---not printing if single row data presents
.....
目前没有回答
相关问题 更多 >
编程相关推荐