Examples for load_data() | Teradata Package for Generative AI - Examples: How to use load_data() - Teradata VantageCloud Lake

Lake - Analyze Your Data with ClearScape Analytics™

Deployment
VantageCloud
Edition
Lake
Product
Teradata VantageCloud Lake
Release Number
Published
February 2025
ft:locale
en-US
ft:lastEdition
2026-02-20
dita:mapPath
tcl1683670667798.ditamap
dita:ditavalPath
pny1626732985837.ditaval
dita:id
tcl1683670667798

Example setup: Import and load modules

>>> from teradataml import *
>>> from teradatagenai import load_data

Example 1: When connection is created without "temp_database_name", the table is loaded in users' default database

>>> con = create_context(host = 'tdhost', username='tduser', password = 'tdpassword')
>>> load_data('employee', 'employee_data')

Create a teradataml DataFrame:

>>> df = DataFrame("employee_data")

Example 2: When connection is created with "temp_database_name" parameter and configuration option "temp_table_database" is also specified, the table is created in the database specified in the configuration option

>>> con = create_context(host = 'tdhost', username='tduser', password = 'tdpassword',
                        temp_database_name = "temp_db")
>>> configure.temp_table_database = "temp_db1"
>>> load_data('employee', 'employee_data')

Create a teradataml DataFrame.

>>> df = DataFrame(in_schema("temp_db1", "employee_data"))