我在我的 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
关于python - Django 多结果集,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20382617/