擅长:python、mysql、java
<p>Python数据库模块文档的主要来源是<a href="http://www.python.org/dev/peps/pep-0249/" rel="nofollow">the DB-API 2.0 specification</a>:</p>
<blockquote>
<pre><code>.rowcount
This read-only attribute specifies the number of rows that
the last .execute*() produced (for DQL statements like
'select') or affected (for DML statements like 'update' or
'insert').
The attribute is -1 in case no .execute*() has been
performed on the cursor or the rowcount of the last
operation is cannot be determined by the interface. [7]
Note: Future versions of the DB API specification could
redefine the latter case to have the object return None
instead of -1.
</code></pre>
</blockquote>