Menu

#27 cursor rowcount is not filled

0.39
open
nobody
None
5
2009-06-19
2009-06-19
nobdy
No

0.39, svn, on Linux against Sybase 12.5

The following code did work on very old versions of python sybase but does not work anymore in the current version or in the svn trunk. The returned rowcount is -1 in all cases.

db=Sybase.connect(database, user ,password)
c=db.cursor('select * from syscolumns)
print c.rowcount

In case of a select statement, of course, the rowcount can be obtained from the length of the fetchall result. The rowcount, however, is more important for the update statements. We want to be able to begin a transaction, update a table, check if the number of rows that would be updated is correct and then depending on this, either commit or roll back.

Discussion


Log in to post a comment.