使用cx_oracle从MERGE返回受影响的行数 [英] Return the number of affected rows from a MERGE with cx_oracle

查看:700
本文介绍了使用cx_oracle从MERGE返回受影响的行数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何通过在CX_Oracle中执行"MERGE INTO ..." sql命令来获得受影响的行数?
每当我在cx_oracle上执行MERGE SQL时,我得到的cursor.rowcount为-1​​.有没有办法获取受合并影响的行数?

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?

推荐答案

由于cx_oracle遵循python DBAPI规范(我认为),因此这是预期的行为". 此处在stackoverflow上已经讨论过.

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

这篇关于使用cx_oracle从MERGE返回受影响的行数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆