Issue with querying Teradata in Python/Pyodbc

一个人想着一个人 提交于 2019-12-03 02:48:00

I had this error, and I found the cause was that pyodbc was 64 bit, whereas my teradata driver was 32. The problem was solved after building a new driver with unixodbc.

Forcing the right locale in setup.py (before compiling) did the trick for me ,example:

import locale
locale.setlocale(locale.LC_ALL, 'es_ES.utf8')

I found that pyodbc out of the box might not work as per http://code.google.com/p/pyodbc/issues/detail?can=1&q=teradata&id=146

I verified the fix in that thread works. Check out https://github.com/mkleehammer/pyodbc, add extra commands to setup.py, recompile, and it appears to work.

If your null character is set to '?' (which I believe is the default) or anything else strange this could be a problem with returning, especially if you are working with the data once it hits python.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!