python odbc connection

Connectivity
Connectivity covers the mechanisms for connecting to the Teradata Database, including driver connectivity via JDBC or ODBC.
Highlighted
Teradata Employee

python odbc connection

has anyone had success connecting python to teradata from a MAC using ODBC connection?

customer is trying to connect using this methodology and getting ODBC not found error

 

import teradata
 
udaExec = teradata.UdaExec (appName="HelloWorld", version="1.0",
        logConsole=False)
 
session = udaExec.connect(method="odbc", system="tdprod",
        username="**bleep**", password="**bleep**");
 
for row in session.execute("SELECT GetQueryBand()"):
    print(row)

Accepted Solutions
Teradata Employee

Re: python odbc connection

See the Teradata Tools and Utilities for Apple OS X Installation Guide for details on ODBC installation and configuration.

1 ACCEPTED SOLUTION
4 REPLIES
Teradata Employee

Re: python odbc connection

Perhaps a silly question, but do they have the required Teradata ODBC driver for Mac OS X installed?

Teradata Employee

Re: python odbc connection

Good question,  I asked that and they said they downloaded it.  I am not a MAC user so I could not walk them through the set up of the odbc as I would with ODBC administrator.

What is the comparable utility on MAC?

Teradata Employee

Re: python odbc connection

Hi,

 

first of all, meanwhile there are two Pythin connectors:

- the "old" Wrapper of ODBC or REST -> import teradata

- the new, native one -> import teradatasql

 

Obviously the example is using the ODBC wrapper. 

 

Your example looks fine in general. It could be due to a wrong "udaexec.ini". Or there is another ODBC driver that has Teradata in its name but ain't the Teradata driver (you can check in ODBC Admin in Drivers tab). In this case it can help to add "driver=Teradata" in the udaexec.ini or directly in the udaExec.connect.

Teradata Employee

Re: python odbc connection

See the Teradata Tools and Utilities for Apple OS X Installation Guide for details on ODBC installation and configuration.