KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I'm having a bit of trouble successfully using pyodbc on Debian Lenny (5.0.7). Specifically, I appear to be having trouble fetching NVARCHAR values (not a SQL Server expert, so go easy on me :) ). Most traditional queries work OK. For instance, a count of rows in table1 yields cursor.execute("SELECT count(id) from table1") <pyodbc.Cursor object at 0xb7b9b170> >>> cursor.fetchall() [(27, )] As does a full dump of ids >>> cursor.execute("SELECT id FROM table1") <pyodbc.Cursor object at 0xb7b9b170> >>> cursor.fetchall() [(0.0, ), (3.0, ), (4.0, ), (5.0, ), (6.0, ), (7.0, ), (8.0, ), (11.0, ), (12.0, ), (18.0, ), (19.0, ), (20.0, ), (21.0, ), (22.0, ), (23.0, ), (24.0, ), (25.0, ), (26.0, ), (27.0, ), (28.0, ), (29.0, ), (32.0, ), (33.0, ), (34.0, ), (35.0, ), (36.0, ), (37.0, )] But a dump of names (again, of type NVARCHAR) does not >>> cursor.execute("SELECT name FROM table1") Traceback (most recent call last): File "<stdin>", line 1, in <module> pyodbc.ProgrammingError: ('42000', '[42000] [FreeTDS][SQL Server]Unicode data in a Unicode-only collation or ntext data cannot be sent to clients using DB-Library (such as ISQL) or ODBC version 3.7 or earlier. (4004) (SQLExecDirectW)') ... the critical error being pyodbc.ProgrammingError: ('42000', '[42000] [FreeTDS][SQL Server]Unicode data in a Unicode-only collation or ntext data cannot be sent to clients using DB-Library (such as ISQL) or ODBC version 3.7 or earlier. (4004) (SQLExecDirectW)') This is consistent across tables. I've tried a variety of different versions of each, but now I'm running unixODBC 2.2.11 (from lenny repos), FreeTDS 0.91 (built from source, with ./configure --enable-msdblib --with-tdsver=8.0 ), and pyodbc 3.0.3 (built from source). With a similar combination (unixOD
Tags (comma-separated)
Save Edits
Cancel