Teradata / PyTd

A Python Module to make it easy to script powerful interactions with Teradata Database in a DevOps friendly way.
MIT License
108 stars 43 forks source link

[Windows 7] : DatabaseError: [HY000] [Teradata][ODBC Teradata Driver][Teradata Database] Invalid SET statement in the triggered action. #78

Closed piotrkuzmiak closed 6 years ago

piotrkuzmiak commented 6 years ago

Teradata drivers are properly installed, Teradata SQL Assistant is able to query DB, but it is not possible using teradata module due to error: DatabaseError: [HY000] [Teradata][ODBC Teradata Driver][Teradata Database] Invalid SET statement in the triggered action.

OS: Windows 7 Enterprise Teradata driver: 64b ver 15.10.01.01

escheie commented 6 years ago

Can you share the contents of the generated log file?

piotrkuzmiak commented 6 years ago

Sure, here you are:

_2017-09-28 08:45:52,997 - teradata.udaexec - ERROR - Unable to create connection: {'method': 'odbc', 'system': 'KHD_LIVE', 'username': 'user', 'password': 'XXXXXX', 'driver': 'Teradata'} Traceback (most recent call last): File "C:\Users\129175\AppData\Local\Continuum\Anaconda3\lib\site-packages\teradata\udaexec.py", line 183, in connect **args)) File "C:\Users\129175\AppData\Local\Continuum\Anaconda3\lib\site-packages\teradata\tdodbc.py", line 460, in init queryTimeout=QUERYTIMEOUT) File "C:\Users\129175\AppData\Local\Continuum\Anaconda3\lib\site-packages\teradata\tdodbc.py", line 592, in execute checkStatus(rc, hStmt=self.hStmt, method="SQLExecDirectW") File "C:\Users\129175\AppData\Local\Continuum\Anaconda3\lib\site-packages\teradata\tdodbc.py", line 209, in checkStatus raise DatabaseError(i[2], u"[{}] {}".format(i[0], msg), i[0]) teradata.api.DatabaseError: (5882, '[HY000] [Teradata][ODBC Teradata Driver][Teradata Database] Invalid SET statement in the triggered action. ')

escheie commented 6 years ago

There looks to be an issue with the QueryBand statement the module is trying to run after establishing the connection. If you turn on debug logging, you should be able to see the SET QUERY_BAND statement that is being submitted to help determine what the problem could be.

piotrkuzmiak commented 6 years ago

closed

we had problems with authentication which probably results with this error. Now it works without errors. Anyway thank you for support

Peter