我试图从 ladon/python 返回 4 到 100 行,但它只返回 for 循环中的第一行。目前它返回
编辑:如果我只是这样做,则 For 循环有效
**for row in cursor:
RSOID = row.RSO_ID
ALIAS=row.ALIAS
Qty=row.QTY
print(RSOID)
print(ALIAS)
print(Qty)**
ItemNum-1234-ItemNum
Quant-1-Quant
RSOID-1-RSOID
这是我的代码:
class OrderLookUpResponse(LadonType):
RSOID = str
ItemNum = str
Quant = str
@ladonize(str,rtype=OrderLookUpResponse)
def LookupOrder(self,OrderID):
cursor.execute("SELECT ALIAS,QTY,RSO_ID FROM RSK_DETAIL WHERE RSO_ID IN(SELECT RSO_ID FROM RSK_ORDER WHERE ACCT_CODE = 'SCRUBBED')")
rows=cursor.fetchall()
for row in rows:
RSOID = row.RSO_ID
ALIAS=row.ALIAS
Qty=row.QTY
result = OrderLookUpResponse()
result.RSOID=RSOID
result.ItemNum=ALIAS
result.Quant=Qty
return result