Installation guide

mxODBC - Python ODBC Database Interface
type
'S1003' is raised whenever trying to read data from the database in this
.stringformat mode.
You can use the included mx/ODBC/Misc/test.pyc script to find out whether
the database backend support Unicode or not.
Binary and other plain data columns will still use 8-bit strings for interfacing,
since storing this data in Unicode objects would cause trouble. mxODBC will
eventually use buffer/memoryview or some form of binary objects to store
binary data in some future version, e.g. the new bytes type which was
introduced with Python 3.
This value is inherited by all cursors created from the connection at creation
time. Note that changing the value of this attribute will not change the string
format for existing cursors using this connection.
.timestampresolution
Use this attribute to adjust the rounding applied when passing second values
with fractions to the database, i.e. from Python to the database
13
. Some
databases complain about their data types not being capable of representing
the precision as given in the fraction value. With others, it is possible to get
rounding errors due to truncation, e.g. of 0.4999 to 0.49 instead of 0.50.
The attribute value must be given as integer and defines the resolution of the
timestamp values in nanoseconds (ns).
Setting the attribute to 1000 would result in Python seconds values to get
rounded to the nearest microsecond prior to passing the value to the database.
Setting it to 250*1000000 would result in seconds to get rounded to the
nearest ¼ second.
Note: Rounding to a full second is prevented to not cause possibly illegal time
values.
Default is 1 nanosecond (.timestampresolution = 1), with the following
exceptions to address limitations in the database engines, which otherwise
cause database errors or warnings:
MS SQL Server 2005 and earlier: 1 millisecond (.timetstampresolution
= 1000000
)
MS SQL Server 2008 and later: 100 nanoseoncds
(
.timestampresolution = 100)
This value is inherited by all cursors created from the connection at creation
time. Note that changing the value of this attribute will not change the
timestamp resolution for existing cursors using this connection.
.warningformat
Use this attribute to change the default warning reporting behavior of
mxODBC, in case you don't want to define your own
.errorhandler.
13
mxODBC applies this rounding when using the ODBC timestamp interface structures and
also applies the rounding to mxDateTime input objects in case the database requests the
date/time value as string. It currently does not apply the rounding for strings in case Python
datetime objects are used on input.
100