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

connection.cursor()

Function

This method returns a new cursor object.

Prototype

cursor(name=None, cursor_factory=None, scrollable=None, withhold=False)

Parameter

Table 1 connection.cursor parameters

Keyword

Description

name

Cursor name. The default value is None.

cursor_factory

Creates a non-standard cursor. The default value is None.

scrollable

Sets the SCROLL option. The default value is None.

withhold

Sets the HOLD option. The default value is False.

Return Value

Cursor object (used for cusors that are programmed using Python in the entire database)

Example

For details, see Example: Common Operations.