han*_*sen 1 python mysql django stored-procedures
我有一个存储过程,我在我的Django应用程序中使用cursor.execute调用.存储过程返回2个结果集,但我似乎无法通过Django访问第二个.访问多个结果集的正确方法是什么?
我最终做了这样的事情:
cursor = connections['prod'].cursor()
cursor.execute('''Your SQL''')
row = cursor.fetchone()
# do what you need to do with the first result set
cursor.nextset() #sets cursor to the next result set
# fetchone or fetchall and do whatever you want with the next result set
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
729 次 |
最近记录: |