| Issue 266: | problem with cursor.description tuple under 64-bit Linux (RHEL 6.2 x86_64) | |
| 1 person starred this issue and may be notified of changes. | Back to list |
I have installed the pyodbc package for both 32-bit and 64-bit Red Hat Enterprise Linux (versions 5.8 and 6.2).
When I examine the name element in the 7-elem tuple from cursor.description, on the 32-bit Linux systems, I get the full column name but on the 64-bit Linux systems, I am only getting the first character of the column name.
cursor.execute(sql)
for col in range(0, len(cursor.description)):
col_name = cursor.description[col][0]
col_type = cursor.description[col][1]
col_size = cursor.description[col][2]
Is there a solution to this problem? Have others seen this on their 64-bit Linux systems.
If I code the equivalent task in Perl on the 64-bit Linux systems, it works so the problem is with the pyodbc package under 64-bit Linux.
Thank you.
Brad
_______________________________
Sep 29, 2012
No response, so closing.
Status:
NoFix
|
I assume you are not passing ansi=True to connect... What db are you using? I'm guessing the issue is that Python is compiled with 4-byte Unicode characters but pyodbc is assuming 2-bytes. Can you run the following: import pyodbc print 'python: %s' % sys.version print 'pyodbc: %s %s' % (pyodbc.version, os.path.abspath(pyodbc.__file__)) print 'odbc: %s' % cnxn.getinfo(pyodbc.SQL_ODBC_VER) print 'driver: %s %s' % (cnxn.getinfo(pyodbc.SQL_DRIVER_NAME), cnxn.getinfo(pyodbc.SQL_DRIVER_VER)) print ' supports ODBC version %s' % cnxn.getinfo(pyodbc.SQL_DRIVER_ODBC_VER) print 'os: %s' % platform.system() print 'unicode: Py_Unicode=%s SQLWCHAR=%s' % (pyodbc.UNICODE_SIZE, pyodbc.SQLWCHAR_SIZE)