PyTd icon indicating copy to clipboard operation
PyTd copied to clipboard

Support for Teradata SIMBA ODBC 16.20 driver + unixODBC?

Open padhia opened this issue 6 years ago • 1 comments

Hi,

With 16.20 SIMBA ODBC driver, Teradata officially supports unixODBC driver manager. I am able use Teradata SEN ODBC driver with unixODBC DM using isql and iusql utilities. I can even get pyodbc to work with Python on Linux platform. However following fails

import teradata.tdodbc
conn = teradata.tdodbc.connect(system='dbc', username='xxxxx', password='xxxxxx')

with following error message:

teradata.api.DatabaseError: (0, '[I] [. Check that the ODBC driver is installed and the ODBCINI or ODBCINST environment variables are correctly set.')

setting ODBCINI to point to a valid odbc.ini file doesn't help.

How can I get unixODBC DM to work with teradata python module?

Thanks

padhia avatar Apr 04 '18 01:04 padhia

It doesn't look like the unixODBC driver manager can be supported without code changes. The DataDirect ODBC driver supported unicode characters via UTF-8 encoding while unixODBC uses UCS2. The disagreement in string encoding causes calls to the unixODBC driver manager to fail.

More investigation is required to see how unixOBDC can be supported. Simply changing create_string_buffer to create_unicode_buffer also failed because python is using UCS4.

escheie avatar Apr 06 '18 23:04 escheie