Installation guide

mxODBC - Python ODBC Database Interface
7. mxODBC Cursor Objects
These objects represent a database cursor: an object which is used to manage the
context of a database query operation.
This includes preparing and parsing the query or command to be executed on the
connection, executing the query or command one or multiple times and providing
a pointer into the result set or sets generated by queries.
7.1 Relationship between Cursors and
Connections
7.1.1 Dependency on the Connection Object
Cursors are created through a database connection. As a result, cursor objects are
only usable as long as the connection object exists and the associated database
connection is open and working.
All operations of a cursor are done through the connection that was used to create
it. The scope and default settings of a cursor are defined by the connection. Once
created, you can change various settings of the cursor, e.g. the
cursor.datetimeformat. Such changes do not affect the connection or any
other cursor objects created on the connection.
Using cursors on a closed connection will result in a
ProgrammingError to be
raised.
7.1.2 Using multiple Cursor Objects on a single Connection
Depending on the capabilities of the database and the used ODBC driver, you can
have multiple cursors open on a single connection and execute queries and
commands on each at will. This makes it possible to e.g. prepare and then cache
often used commands.
102