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

Alexandre Fayolle alexandre.fayolle at logilab.fr
Tue Apr 13 12:44:27 CEST 2010


I have an application which currently runs with pyodbc to connect to an 
SQLServer 2005 database. It works fine but very slowly (50x more slowly than 
the same app running against PostrgreSQL via psycopg2), and this might kill 
our so I'm investigating if mx.ODBC could improve the perfs in which case I'll 
be happy to to buy a licence. 

I've solved a couple of easy problems concerning the SQL <-> Python mapping 
differences between pyodbc and mx.ODBC, but I have an issue with the following 

SELECT ? FROM owned_by_relation 
WHERE eid_from=? AND eid_to=? 

which is executed with parameters (2031, 2031, 5)

This query runs fine with pyodbc (and psycopg, mysqldb, sqlite...) but with 
mx.ODBC it generates 

InterfaceError: ('07009', 0, '[Microsoft][SQL Server Native Client 
10.0]Invalid Descriptor Index', 7513) 

The problem is with the first ? (in the SELECT part of the request).

My options in tweaking the SQL are somewhat limited, because the SQL is 
generated by some kind of ORM and we want to keep the rest of the code base as 
backend-agnostic as possible. 

I've seen http://www.egenix.com/mailman-archives/egenix-users/2009-
May/114571.html suggesting to use executedirect, but when I tried that, the 
program crashed in another place because of date/time issues:

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 

platform information: 

* windows server 2003
* python 2.5.4
* mxODBC 3.04
* mx Base 3.1.3
* SQL Server 2005
* ODBC Driver : SQL Server Native Client 10.0

Thanks in advance

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