MySQLdb: execute query results...
mack at incise.org
Mon Sep 1 02:14:00 CEST 2003
On Sun, Aug 31, 2003 at 11:57:07PM +0000, Sheila King wrote:
> Here is what I *think* I know...let me know if I'm wrong, for crying out
> >>> result = c.execute("""<some proper MySQL query here>""")
> doesn't result always return the number of affected rows?
> Can I *RELY* on that "2L" result of the UPDATE statement under the cursor's
> "execute" method representing the number of rows updated? Or am I assuming
> too much?
Looked in site-packages/MySQLdb/cursors.py, and it seems you are
>>> from MySQLdb import cursors
Help on method execute in module MySQLdb.cursors:
execute(self, query, args=None) unbound MySQLdb.cursors.BaseCursor
Execute a query.
Returns long integer rows affected, if any
Nick Welch aka mackstann | mack @ incise.org | http://incise.org
All the good ones are taken.
More information about the Python-list