[Zope-DB] reading rowcount after calling zsql

Werner Hennrich wehe@gmx.at
Tue, 23 Jul 2002 21:39:46 +0200


Hello everybody,
I'm looking for a solution to this problem:

1) I'm calling an ZSQL-Method (from a pythnon script)

2) the ZSQL updates a record only if a timestamp hasn't changed since last
read ("update table set field1=newvalue, f2=etc, timestamp=newtimestamp
where id=key and timestamp=oldtimestamp")

3) after that I want the calling script to check if an update has occured
(so I can issue an error message).

I'm looking for a way to obtain the number of records; my rdbms (postgresql)
dosn't have a construct to query this, but the db-driver in zope (it is
DB-API 2.0 compliant) can tell via 'driver.cursor().rowcount()' - but how
can I get the cursor-object of a ZSQL-Method?

any ideas?
thanks for your attention and help....

Werner