Skip to content

Update for Teradata

Compare
Choose a tag to compare
@mkleehammer mkleehammer released this 16 Feb 22:03
· 343 commits to master since this release

Recently a change was made to use SQLDescribeColW so that Unicode column names could be retrieved properly. Unfortunately this uncovered some weirdness with some drivers, this time Teradata.

I'm not sure if the issue is iODBC (which Apple doesn't ship anymore) is using a 4-byte
SQLWCHAR or if Teradata is returning UCS4/UTF-32LE for column names in SQLDescribeColW. Either
way I've added a hack that assumes 4-byte chars if the decoding for SQL_WMETADATA (a pyodbc
specific constant) is set to any of the UTF-32 encodings. The encoding is then actually used.

cnxn.setdecoding(pyodbc.SQL_WMETADATA, encoding='utf-32le')

Fixes #194