names [rec[ for rec in curs fetchall()names ['bob''sue''ann''tom''kim''pat'the fetchall call we've used so far fetches the entire query result table all at onceas single sequence (an empty sequence comes backif the result is emptythat' convenientbut it may be slow enough to block the caller temporarily for large result tables or generate substantial network traffic if the server is running remotely (something could easily require parallel thread in guito avoid such bottleneckwe can also grab just one rowor bunch of rowsat time with fetchone and fetchmany the fetchone call returns the next result row or none false value at the end of the tablecurs execute('select from people'while truerow curs fetchone(if not rowbreak print(row('bob''dev' ('sue''mus' ('ann''mus' ('tom''mgr' ('kim''adm' ('pat''dev' the fetchmany call returns sequence of rows from the resultbut not the entire tableyou can specify how many rows to grab each time with parameter or rely on the default as given by the cursor' arraysize attribute each call gets at most that many more rows from the result or an empty sequence at the end of the tablecurs execute('select from people'while truerows curs fetchmany(if not rowsbreak for row in rowsprint(row('bob''dev' ('sue''mus' ('ann''mus' ('tom''mgr' ('kim''adm' ('pat''dev' size= optional argument for this module at leastthe result table is exhausted after fetchone or fetchmany returns false value the db api says that fetchall returns "all (remainingrows,so you generally need to call execute again to regenerate results before fetching new datacurs fetchone(curs fetchmany([sql database interfaces