win32all odbc/MS SQLServer/bigint

Bjorn Pettersen BPettersen at
Sat Apr 12 08:59:23 CEST 2003

We were using the win32all odbc module, trying to fix some records in
our database. Our account IDs are of SQL type bigint, i.e. __int64 if
you're on MS. After seeing incorrect results (and spending some time
looking at our own code), it turns out that the odbc module silently
corrupts data in paramters passed to cursor.execute(). Has anyone seen
this/got a workaround for it (we're currently cast'ing to varchar on
selects, and doing string substitution elsewhere, which is killing
performance, and we can't get it to work in subselects...)? I looked at
the mxODBC documentation, and it says it's doing a conversion
[automatic] to string for bigint data... (again too slow). I'm pretty
flummoxed, the ODBC C calls for bigint/__int64 are pretty straight

As an added bonus, someone had the pleasure of showing me that a simple
select/fetchall (i.e. all C code for Python), was over three times
faster in C#..., and the win32all odbc module has crashed python
somewhere deep down in sql three times in the last two hours (we're
expecting this app to run for ~4 days...). Looks like it's back to C++

-- bjorn

More information about the Python-list mailing list