Return the number of affected rows from a MERGE with cx_oracle

£可爱£侵袭症+ 提交于 2020-01-04 02:07:28

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!