How can I get number of rows update for a update statement?

I am running this inside a transaction...

def update_session(transaction):
    global code
    global sessionexists
    count = transaction.execute_sql("update sessions set seentime=@t where sessioncode=@s", params={"s":code,"t":datetime.utcnow()}, 
       param_types={"t": spanner.param_types.TIMESTAMP})
    print("count "+str(count))
    sessionexists = 0
    for c in count:
        print(c)
        sessionexists = c

This does not seem to return number of rows updated... Is there way to do it? Solution:
Based on the valid answer...this seems to work as well

count = transaction.execute_update("update sessions set seentime=@t where sessioncode=@s", params={"s":code,"t":datetime.utcnow()}, 
       param_types={"s": spanner.param_types.STRING,"t": spanner.param_types.TIMESTAMP})
count is the number of rows

.

1 answer

How many English words
do you know?
Test your English vocabulary size, and measure
how many words do you know
Online Test
Powered by Examplum