[egenix-users] mx.ODBC error: Invalid Descriptor Index

Alexandre Fayolle alexandre.fayolle at logilab.fr
Thu Apr 15 18:14:02 CEST 2010

On Tuesday 13 April 2010 12:03:27 M.-A. Lemburg wrote:
> Hello Alexandre,

Hello Marc Andre, 

Thanks for your detailed answer. I was not aware of the SELECT list limitation 
on parameters. I shall investigate if we can twist the ORM around this to use 
the more efficient method (as what I'm after is speed). 

> >
> > mx.ODBC.Error.DataError: ('22008', 0, '[Microsoft][SQL Server Native
> > Client 10.0]Datetime field overflow. Fractional second precision exceeds
> > the scale specified in the parameter binding.', 7748)
> >
> > At this point, I'm a bit stuck and would appreciate any help
> How are you passing those date/time values to mxODBC ? As
> mxDateTime instances, strings or datetime module instances ?
> An ODBC trace log would help find out what the ODBC driver
> is asking for.

Here's some additional information on this specific bug (the %(name)s quoting 
in the SQL is processed to use the ? style quoting):

sql: 'UPDATE cw_CWUser SET cw_modification_date = %(cw_modification_date)s, 
cw_last_login_time = %(cw_last_login_time)s WHERE cw_eid = %(cw_eid)s'

 args: {'cw_eid': 5, 'cw_modification_date': datetime.datetime(2010, 4, 15, 16, 
51, 25, 468000), 'cw_last_login_time': datetime.datetime(2010, 4, 15, 16, 51, 
25, 453000)}

Basically, the datetime values are obtained using datetime.datetime.now(). The 
column in the database use MS SQL datetime type. 

As for the ODBC trace log, I could not generate it. I have installed mxODBC 
and mxBase using MSI installers: do these include the debug support mentioned 
in the documentation, or do I have to use the ZIP prebuilt packages?

Alexandre Fayolle                              LOGILAB, Paris (France)
Formations Python, CubicWeb, Debian :  http://www.logilab.fr/formations
Développement logiciel sur mesure :      http://www.logilab.fr/services
Informatique scientifique:               http://www.logilab.fr/science

More information about the egenix-users mailing list