Closed vedbeau closed 6 years ago
Created a file udaexec.ini in /root,but still getting the same problem. Please help /****
I can connect to teradata server with Python 3.5. Here is my example. Have you installed Teradata ODBC Driver for Linux?
~/GitHub/tdpy $ pyenv version
3.5.0 (set by /Users/ebyhr/GitHub/tdpy/.python-version)
~/GitHub/tdpy $
~/GitHub/tdpy $ cat tdpy.py
import teradata
udaExec = teradata.UdaExec (appName="tdpy", version="1.0",logConsole=False)
session = udaExec.connect(method="odbc", system="wbtlabserver.teradata.com", username="testuser", password="***");
for row in session.execute("SELECT GetQueryBand()"):
print(row)
session2 = udaExec.connect("WBT");
for row in session2.execute("SELECT GetQueryBand()"):
print(row)
~/GitHub/tdpy $
~/GitHub/tdpy $ cat udaexec.ini
# Application Configuration
[CONFIG]
appName=TdPy
version=0.1
logConsole=False
dataSourceName=WBT
table=DBC.DBCInfo
# Default Data Source Configuration
[DEFAULT]
method=odbc
charset=UTF8
# Data Source Definition
[WBT]
system=wbtlabserver.teradata.com
username=testuser
password=***
~/GitHub/tdpy $
~/GitHub/tdpy $ python tdpy.py
Row 1: [=S> ApplicationName=tdpy;Version=1.0;JobID=20180314220449-8;ClientUser=ebyhr;Production=False;udaAppLogFile=/Users/ebyhr/GitHub/tdpy/logs/tdpy.20180314220449-8.log;UtilityName=PyTd;UtilityVersion=15.10.0.21;]
Row 1: [=S> ApplicationName=tdpy;Version=1.0;JobID=20180314220449-8;ClientUser=ebyhr;Production=False;udaAppLogFile=/Users/ebyhr/GitHub/tdpy/logs/tdpy.20180314220449-8.log;UtilityName=PyTd;UtilityVersion=15.10.0.21;]
~/GitHub/tdpy $
Hi , Thanks for the update Below is the code which i'm using in python.I'm able to connect using BTEQ with LDAP credentials. I'm getting [Teradata][ODBC Teradata Driver][Teradata Database] (210) The UserId, Password or Account is invalid. FailCode = -8017') while executing in python. But i am able to connect through BTEQ
import teradata udaExec = teradata.UdaExec (appName="HelloWorld", version="1.0",logConsole=True) session = udaExec.connect(method="odbc", system="xxxx",username="ravina",password="xxxx");
udaexec.ini file
[CONFIG] appName=HelloWorld version=0.1 logConsole=True dataSourceName=Teradata ODBC DSN table=DBC.DBCInfo
[DEFAULT] method=odbc charset=UTF8
[Teradata ODBC DSN] system=hostname username=ravina password=xxxx
Thanks in advance
Would you change following 2 lines?
session = udaExec.connect("Teradata ODBC DSN");
authentication=LDAP
in udaexec.inipython script
import teradata
udaExec = teradata.UdaExec (appName="HelloWorld", version="1.0",logConsole=True)
session = udaExec.connect("Teradata ODBC DSN");
udaexec.ini
# Application Configuration
[CONFIG]
appName=HelloWorld
version=0.1
logConsole=True
dataSourceName=Teradata ODBC DSN
table=DBC.DBCInfo
# Default Data Source Configuration
[DEFAULT]
method=odbc
charset=UTF8
authentication=LDAP
# Data Source Definition
[Teradata ODBC DSN]
system=hostname
username=ravina
password=xxxx
odbc.ini [ODBC]
InstallDir=/opt/teradata/client/16.20/odbc_64 Trace=no Pooling=yes
[ODBC Data Sources] Teradata ODBC DSN=Teradata Database ODBC Driver 16.20
[Teradata ODBC DSN]
Description=Teradata Database ODBC Driver 16.20
Driver=/opt/teradata/client/16.20/odbc_64/lib/tdataodbc_sb64.so
DBCName=hostname UID=ravina
session = udaExec.connect("Teradata ODBC DSN") 2018-03-15 06:03:19,666 - teradata.udaexec - INFO - Creating connection: {'externalDSN': 'Teradata ODBC DSN', 'username': 'ravina', 'authentication': 'LDAP', 'method': 'odbc', 'system': '10.233.131.80', 'charset': 'UTF8', 'password': 'XXXXXX'} 2018-03-15 06:03:19,667 - teradata.tdodbc - INFO - Loading ODBC Library: libodbc.so 2018-03-15 06:03:19,670 - teradata.tdodbc - INFO - Available drivers: ODBC Drivers, Teradata 2018-03-15 06:03:19,672 - teradata.udaexec - ERROR - Unable to create connection: {'externalDSN': 'Teradata ODBC DSN', 'username': 'ravina', 'authentication': 'LDAP', 'method': 'odbc', 'system': '10.233.131.80', 'charset': 'UTF8', 'password': 'XXXXXX'}
Hi , I'm able to connect now. I appreciate your support. Thank you so much
Hi, Please help me to fix this issue