问题
How can you get the number of affected rows from executing a "MERGE INTO..." sql command within CX_Oracle?
When ever I execute the MERGE SQL on cx_oracle, I get a cursor.rowcount of -1. Is there a way to get the number of rows affected by the merge?
回答1:
Since cx_oracle follows the python DBAPI specification (I presume), this is expected 'behaviour'. The exact same problem was discussed here on stackoverflow before.
Some more links with possible solutions:
- http://www.oracle-developer.net/display.php?id=220
- http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:122741200346595110
来源:https://stackoverflow.com/questions/1401328/return-the-number-of-affected-rows-from-a-merge-with-cx-oracle