pyodbc return multiple cursors from stored procedure with DB2

后端 未结 2 1389
借酒劲吻你
借酒劲吻你 2020-12-21 11:49

I have a python program that calls a stored procedure from db2 database. I am using results = cursor.fetchall() to process the results of my stored procedure. H

2条回答
  •  清歌不尽
    2020-12-21 12:25

    Just a small simplification for the record:

    while True:    
        rows = cursor.fetchall()
        # process all result sets in the same place
        if not cursor.nextset():
            break    
    

提交回复
热议问题