mysqldb: Rows READ or Processed
Steve Holden
steve at holdenweb.com
Wed Feb 6 21:35:22 EST 2008
Carsten Haese wrote:
> On Wed, 2008-02-06 at 18:53 -0500, Steve Holden wrote:
>> If you mean the number of (say) rows updated by a SQL UPDATE statement,
>> the DB API does not provide any way to access that information
>
> It doesn't? Isn't that what cursor.rowcount does?
>
When it works, yes. Perhaps I should have said that the method provided
by the DB API isn't reliably implemented (for example, on SQL Server
2000 via mx.ODBC it would use a forward cursor which had no predictive
ability about its contents).
The specification says: """the attribute is -1 in case no executeXXX()
has been performed on the cursor or the rowcount of the last operation
is not determinable by the interface. [7]"""
and the footnote points out that the value is "dynamically updatable"
(i.e. not reliable 100% of the time).
Anyway, since the OP just wanted total row count this discussion is moot.
regards
Steve
--
Steve Holden +1 571 484 6266 +1 800 494 3119
Holden Web LLC http://www.holdenweb.com/
More information about the Python-list
mailing list