[cx-oracle-users] cursor.rowcount not functioning as expected
Brought to you by:
atuining
|
From: <ejo...@ea...> - 2015-11-03 16:43:27
|
I haven't seen any messages on this list for several days.
I'm not sure if things are just quiet or I am having issues with the list server.
My apologies if this is duplicate - I never saw any response, so I am sending it again.
(If this message was already received and there have been responses then I am indeed
having mail list issues and I am not sure how to resolve that - please copy any other
responses directly to me.)
I am starting to use cx_Oracle and happy to have it so, thanks Anthony for sharing your work.
Maybe I am not understanding something about the documentation of cursor.rowcount
The documentation at:
https://www.python.org/dev/peps/pep-0249/#cursor-attributes says:
.rowcount
This read-only attribute specifies the number of rows that the last .execute*() produced (for DQL statements like SELECT ) or affected (for DML statements like UPDATE or INSERT ).
I have a cursor variable in the interpreter as 'cur':
>>> cur.execute('select * from isotope')
<__builtin__.OracleCursor on <cx_Oracle.Connection to some_user@some_sid>>
>>> cur.rowcount
0
>>> recs = cur.fetchall()
>>> recs[0]
('Co-55', 'Cobalt 55', None, None)
>>> len(recs)
389
>>> cur.rowcount
389
I think cur.rowcount should return 389 in the first call above.
Is that not the right interpretation?
Thanks,
Erik Johnson
|