2010-11-11 89 views

回答

4

fetchall做它說的 - 它提取所有。那之後什麼都沒有了。要獲得更多結果,您需要運行另一個查詢(或再次查詢同一個查詢)。

從Python db-api 2.0 specification

cursor.fetchall() 

     Fetch all (remaining) rows of a query result, returning 
     them as a sequence of sequences (e.g. a list of tuples). 
     Note that the cursor's arraysize attribute can affect the 
     performance of this operation. 

cursor.fetchone() 

     Fetch the next row of a query result set, returning a 
     single sequence, or None when no more data is 
     available. [6] 
+0

不過,什麼是 「一」?檢索到的查詢的一項? – relima 2010-11-11 02:47:34

+0

@relima:「檢索到的查詢中的一項?」它還能是什麼? – 2010-11-11 02:52:40

+0

@relima:從文檔中添加引用 – 2010-11-11 02:53:36