Re: How to interpret the cursor.rowcount?

Andrew McNamara <[email protected]>
Newsgroups gmane.comp.python.sybase
Message-ID <[email protected]>
>In particular, when a query does not return any matching
>row, the versions up to 0.36pre6 set the value of
>cursor.rowcount to 0 (what I really expected it to be).
>With 0.36, the value becomes -1.

I would guess it's been done to improve compliance with the Python
Database API Specification 2.0, which has the following to say about
rowcount:

    This read-only attribute specifies the number of rows that the last
    executeXXX() produced (for DQL statements like select) or affected
    (for DML statements like update or insert).

    The attribute is -1 in case no executeXXX() has been performed on
    the cursor or the rowcount of the last operation is not determinable
    by the interface.[7]

-- 
Andrew McNamara, Senior Developer, Object Craft
http://www.object-craft.com.au/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.