Updated on 2025-10-23 GMT+08:00

cursor.fetchmany(size=None)

Description

This method returns a list containing multiple rows of data. Each row of data is usually represented as a tuple or an object of a similar structure. If the size parameter is set, the returned list contains the specified number of rows. If the size parameter is not set, as many rows as possible are returned until all rows in the result set have been returned.

Prototype

cursor.fetchmany(size=None)

Parameters

Table 1 cursor.fetchmany

Keyword

Parameter Description

size

Number of rows of returned data.

Return Value

Tuple list.

Examples

For details, see Examples: Common Operations.