Installation guide

mxODBC - Python ODBC Database Interface
If
parametertypes are given, the method returns a tuple copy of the
parameters sequence, with output and input/output parameter values replaced
by the updated values from the database.
Without
parametertypes, the method returns None.
.executedirect(sqlcmd, parameters=(), parametertypes=None)
This method works just like .execute(), except that no prepare step is issued
and the
sqlcmd is not cached. This can result in better performance with some
ODBC driver setups, but also implies that Python type binding mode is used to
bind the parameters. All SQL command parsing is then pushed from the client
side to the server side.
sqlcmd may be a Unicode object in case the ODBC driver and/or database
support this.
Return values are the same as for
cursor.execute().
.executemany(sqlcmd, batch=(), direct=0, parametertypes=None)
Prepare a database operation (query or command) and then execute it against
all parameter sequences found in the sequence, iterator or generator
batch.
The same comments as for
.execute() also apply accordingly to this method.
If the optional integer
direct is given and true, mxODBC will not cache the
sqlcmd, but submit it for one-time execution to the database. This can result in
better performance with some ODBC driver setups, but also implies that
Python type binding mode is used to bind the parameters.
sqlcmd may be a Unicode object in case the ODBC driver and/or database
support this.
If
parametertypes are given, the method returns a list of tuple copies of the
batch parameter sequence, with output and input/output parameter values
replaced by the updated values from the database.
15
Without
parametertypes, the method returns None.
.fetchall()
Fetch all (remaining) rows of a query result, returning them as a sequence of
sequences (e.g. a list of tuples).
An
Error (or subclass) exception is raised if the previous call to .execute*()
did not produce any result set or no call was issued yet.
.fetchmany([size=cursor.arraysize])
Fetch the next set of rows of a query result, returning a sequence of sequences
(e.g. a list of tuples). An empty sequence is returned when no more rows are
available.
15
While this can be used to issue multiple stored procedure calls and retrieve data from the
database via output parameters, not all databases support multiple batched calls. The
database will then raise a function sequence error or similar as a result. PostgreSQL is one
such database.
106