mysqldb: Rows READ or Processed
carsten at uniqsys.com
Thu Feb 7 06:18:28 CET 2008
On Wed, 2008-02-06 at 21:35 -0500, Steve Holden wrote:
> 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).
Yes, and the same will happen with Informix on a SELECT statement, for
pretty much the same reason. However, you have claimed that the number
of rows updated by an UPDATE statement is not provided, and I have yet
to see a DB-API implementation that doesn't set cursor.rowcount
correctly after executing an UPDATE statement. (The spec doesn't require
that the rowcount be set reliably after an update, but any sane database
engine ought be able to tell you how many rows it touched in an update!)
Anyway, as you said, the point is moot, I just wanted to make sure we're
all on the same page.
More information about the Python-list