On Thu, 26 Apr 2007 18:18:57 -0700, John Nagle <nagle@animats. com>
declaimed the following in comp.lang.pytho n:
>
>Carl K wrote:
>>using MySQLdb, I do cursor.execute( "update..." )
>>>
>>How can I tell how many rows were affected ?
>>>
>>Carl K
> cursor = db.cursor() # get cursor
> cursor.execute( sqlstatement, argtuple) # do command
>
According to the documentation, it may be possible to get the result
with
>
rws = cursor.execute( ...)
>
>
-=-=-=-=-=-=-
>>>help(cr.exec ute)
Help on method execute in module MySQLdb.cursors :
>
execute(self, query, args=None) method of MySQLdb.cursors .Cursor
instance
Execute a query.
>
query -- string, query to execute on server
args -- optional sequence or mapping, parameters to use with query.
>
Note: If args is a sequence, then %s must be used as the
parameter placeholder in the query. If a mapping is used,
%(key)s must be used as the placeholder.
>
Returns long integer rows affected, if any
>
-=-=-=-=-=-=-
Comment