Python module for Teradata

Tools & Utilities

Python module for Teradata

Hi

I have installed python from Anaconda Continuum and later installed teradata module

conda install teradata

It installed successfully then ran the hello world program like this

import teradata

udaExec = teradata.UdaExec(appName="Hello World", version=1.0, logConsole=False)

session = udaExec.connect(method="odbc", host="tdadhoc.intra.searshc.com", username="###########", password="##########")

query1 = "select count(*) from crm_perm_tbls.EADP_Sears_POS_dtl"
query = "SELECT GetQueryBand()"

for row in session.execute(query=query):
print(row)

When I ran the query I got this error

Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/srinath/anaconda3/lib/python3.5/site-packages/teradata/udaexec.py", line 172, in connect
**args))
File "/home/srinath/anaconda3/lib/python3.5/site-packages/teradata/tdodbc.py", line 358, in __init__
checkStatus(rc, hDbc=self.hDbc, method="SQLDriverConnectW")
File "/home/srinath/anaconda3/lib/python3.5/site-packages/teradata/tdodbc.py", line 194, in checkStatus
raise DatabaseError(i[2], u"[{}] {}".format(i[0], i[1]), i[0])
teradata.api.DatabaseError: (0, '[I] [')

Nowhere in the forums the solution to this is given, please help me with it.

1 REPLY
Fan

Re: Python module for Teradata

Hi,

Could you please share the details on how you resolved the issue? I also have the same issue. Appreciate your help.