mx.DateTime, mx.ODBC.Windows, and MS SQL Server - Fractional truncation error

M.-A. Lemburg mal at lemburg.com
Tue May 15 03:53:56 EDT 2001


robin and jim wrote:
> 
> Has anyone seen this type of SQL error with mx.DateTime, mx.ODBC.Windows,
> and MS SQL Server?
> 
> import mx.DateTime
> 
> date_time_0 = mx.DateTime.GregorianDateTime (2001, 5, 14, 17, 12, 47.20)
> date_time_1 = mx.DateTime.GregorianDateTime (2001, 5, 14, 17, 13, 14.978)
> 
> date_time_0 can be inserted in a table containing an SQL DATETIME data type
> column.
> 
> date_time_1 can NOT be inserted in a table containing an SQL DATETIME data
> type column.
> The error message is:
> ('01004', 0, '[Microsoft][ODBC SQL Server Driver]Fractional truncation',
> 4479)

Looks like MS SQL Server's ODBC driver is being too careful again.
What you are seeing there is a SQL warning which mxODBC translates
into an exception.

One of the future mxODBC versions will replace the warning to exception
translation with a different error handling mechanism (e.g. a list
of messages which you can query by accessing an attribute .warnings),
but currently there's no way to work around this other than
by recompiling the package with -DDONT_REPORT_WARNINGS.
 
> Some details about the execution framework are:
> 
> Python 2.0
> mx.DateTime 2.0.0
> mx.ODBC 2.0.1
> MS SQL Server 2000
> MS Windows 2000
> 
> Thanks in advance for any suggestions.
> 
> --
> http://mail.python.org/mailman/listinfo/python-list

-- 
Marc-Andre Lemburg
______________________________________________________________________
Company & Consulting:                           http://www.egenix.com/
Python Software:                        http://www.lemburg.com/python/




More information about the Python-list mailing list