Fetch all (remaining) rows of a query result.
Cursor.fetchall()
void | No arguments |
This method returns all (remaining) rows of a query result, returning a list. This is a DB API compliant call. An empty list is returned when no rows are available. Note that the cursor’s arraysize attribute can affect the performance of this operation.
list | The set of rows remaining or an empty list |
conn = db.connect() cursor = conn.cursor() cursor.execute("SELECT * FROM Metatable WHERE TableName='%s'" % clsname) res = cursor.fetchall() ... cursor.close() conn.rollback()