Module Interface

ceODBC.Binary(string)

Construct an object holding a binary (long) string value.

ceODBC.Connection(dsn[, autocommit = False])
ceODBC.connect(dsn[, autocommit = False])

Constructor for creating a connection to the database. Return a Connection object (ref{connobj}). The only required argument is the DSN in the format that ODBC expects. The autocommit flag can be set in the constructor or it can be manipulated after the connection has been established. If you are using a driver that does not handle transactions, ensure that this value is set to true or you may get a “driver not capable” exception.

ceODBC.Cursor(connection)

Constructor for creating a cursor. Return a new Cursor object (Cursor Object) using the connection.

Note

This method is an extension to the DB API definition.

ceODBC.Date(year, month, day)

Construct an object holding a date value.

ceODBC.DateFromTicks(ticks)

Construct an object holding a date value from the given ticks value (number of seconds since the epoch; see the documentation of the standard Python time module for details).

ceODBC.Time(hour, minute, second)

Construct an object holding a time value.

ceODBC.TimeFromTicks(ticks)

Construct an object holding a time value from the given ticks value (number of seconds since the epoch; see the documentation of the standard Python time module for details).

ceODBC.Timestamp(year, month, day, hour, minute, second)

Construct an object holding a time stamp value.

ceODBC.TimestampFromTicks(ticks)

Construct an object holding a time stamp value from the given ticks value (number of seconds since the epoch; see the documentation of the standard Python time module for details).

Constants

ceODBC.apilevel

String constant stating the supported DB API level. Currently ‘2.0’.

ceODBC.buildtime

String constant stating the time when the binary was built.

Note

This attribute is an extension to the DB API definition.

ceODBC.BINARY

This type object is used to describe columns in a database that are binary.

ceODBC.DATETIME

This type object is used to describe columns in a database that are dates.

ceODBC.NUMBER

This type object is used to describe columns in a database that are numbers.

ceODBC.paramstyle

String constant stating the type of parameter marker formatting expected by the interface. Currently ‘qmark’ as in ‘where name = ?’.

ceODBC.ROWID

This type object is used to describe the pseudo column “rowid”.

ceODBC.STRING

This type object is used to describe columns in a database that are strings.

ceODBC.threadsafety

Integer constant stating the level of thread safety that the interface supports. Currently 2, which means that threads may share the module and connections, but not cursors. Sharing means that a thread may use a resource without wrapping it using a mutex semaphore to implement resource locking.

ceODBC.version

String constant stating the version of the module. Currently ‘2.0.1‘.

Note

This attribute is an extension to the DB API definition.

Exceptions

exception ceODBC.Warning

Exception raised for important warnings and defined by the DB API but not actually used by ceODBC.

exception ceODBC.Error

Exception that is the base class of all other exceptions defined by ceODBC and is a subclass of the Python StandardError exception (defined in the module exceptions).

exception ceODBC.InterfaceError

Exception raised for errors that are related to the database interface rather than the database itself. It is a subclass of Error.

exception ceODBC.DatabaseError

Exception raised for errors that are related to the database. It is a subclass of Error.

exception ceODBC.DataError

Exception raised for errors that are due to problems with the processed data. It is a subclass of DatabaseError.

exception ceODBC.OperationalError

Exception raised for errors that are related to the operation of the database but are not necessarily under the control of the progammer. It is a subclass of DatabaseError.

exception ceODBC.IntegrityError

Exception raised when the relational integrity of the database is affected. It is a subclass of DatabaseError.

exception ceODBC.InternalError

Exception raised when the database encounters an internal error. It is a subclass of DatabaseError.

exception ceODBC.ProgrammingError

Exception raised for programming errors. It is a subclass of DatabaseError.

exception ceODBC.NotSupportedError

Exception raised when a method or database API was used which is not supported by the database. It is a subclass of DatabaseError.

Variable Types

Note

The DB API definition does not define these objects.

These classes all create variable objects (Variable Objects). They are created implicitly by cursor.execute() as needed and normally need not be created directly. These classes can also be passed in to cursor.setinputsizes() in favor of the types defined by the DB API in order to have finer control over the types of variables created.

ceODBC.BigIntegerVar

Variable used to bind and/or fetch big integers. Values are returned as Python longs and accept Python integers or longs.

ceODBC.BinaryVar

Variable used to bind and/or fetch binary data. Values are returned as Python buffer objects and accept Python objects that implement the buffer protocol.

ceODBC.BitVar

Variable used to bind and/or fetch bits. Values are returned as Python booleans and accept the same.

ceODBC.DateVar

Variable used to bind and/or fetch dates. Values are returned as Python datetime.date objects and accept Python datetime.date or datetime.datetime objects.

ceODBC.DecimalVar

Variable used to bind and/or fetch decimal numbers. Values are returned as Python decimal.Decimal objects and accept the same.

ceODBC.DoubleVar

Variable used to bind and/or fetch floating point numbers. Values are returned as Python floats and accept Python integers or floats.

ceODBC.IntegerVar

Variable used to bind and/or fetch integers. Values are returned as Python integers and accept the same.

ceODBC.LongBinaryVar

Variable used to bind and/or fetch long binary data. Values are returned as Python buffer objects and accept Python objects that implement the buffer protocol.

ceODBC.LongStringVar

Variable used to bind and/or fetch long string data. Values are returned as Python strings and accept the same.

ceODBC.StringVar

Variable used to bind and/or fetch string data. Values are returned as Python strings and accept the same.

ceODBC.TimeVar

Variable used to bind and/or fetch time data. Values are returned as Python datetime.time objects and accept Python datetime.time or datetime.datetime objects.

ceODBC.TimestampVar

Variable used to bind and/or fetch timestamps. Values are returned as Python datetime.datetime objects and accept Python datetime.date or datetime.datetime objects.

Table Of Contents

Previous topic

ceODBC

Next topic

Connection Object