Re: mx.ODBC error: Invalid Descriptor Index

Alexandre Fayolle <alexandre.fayolle-yG1kfhx/[email protected]>
Newsgroups gmane.comp.python.egenix.user
Organization Logilab
Message-ID <[email protected]>
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?

Regards,
 
-- 
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


_______________________________________________________________________
eGenix.com User Mailing List                     http://www.egenix.com/
https://www.egenix.com/mailman/listinfo/egenix-users
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.