Connecting to Teradata from Domino




Overview

Teradata Vantage is a multi-cloud data platform providing access to data lakes, data warehouses, and analytics. This article describes how to connect to Teradata from Domino. In order to connect successfully, you must have network connectivity between Teradata and your Domino deployment.




Connecting to Teradata with Python

Domino recommends the Teradata SQL Driver for Python.


Environment setup

The Teradata SQL driver for Python comes pre-installed in many Domino environments, however, if you are working in an environment without it installed by default you can add it to your environment using the following dockerfile instructions:

RUN pip install teradatasql

For a basic introduction to modifying Domino environments, watch this tutorial video

Credential setup

There are several environment variables you should set up to store secure information about your Teradata connection. Set the following as Domino environment variables on your user account:

  • TERADATA_USER

  • TERADATA_PASSWORD

  • TERADATA_HOST

Read Environment variables for secure credential storage to learn more about Domino environment variables.


Usage

Read the Teradata SQL Driver for Python documentation for detailed information on how to use the package. Below is a simple example.

import teradatasql
import os

con = teradatasql.connect(
    user=os.environ['TERADATA_USER'],
    password=os.environ['TERADATA_PASSWORD'],
    host=os.environ['TERADATA_HOST']
    )
cur = con.cursor()
try:
    cur.execute ('{fn teradata_nativesql}Driver version {fn teradata_driver_version}  Database version {fn teradata_database_version}')
    print (cur.fetchone () [0])
finally:
    cur.close()
con.close()

Additional resources

Teradata SQL Driver for R