list_td_reserved_keywords() | Teradata Package for Python - list_td_reserved_keywords() - Teradata Package for Python

Teradata® Package for Python User Guide

Deployment
VantageCloud
VantageCore
Edition
VMware
Enterprise
IntelliFlex
Product
Teradata Package for Python
Release Number
20.00
Published
March 2025
ft:locale
en-US
ft:lastEdition
2026-01-07
dita:mapPath
nvi1706202040305.ditamap
dita:ditavalPath
plt1683835213376.ditaval
dita:id
rkb1531260709148
Product Category
Teradata Vantage

Use the list_td_reserved_keywords() function to validate if the specified string or list of strings is a Teradata reserved keyword or not.

If a key is not specified in the function call, all the Teradata reserved keywords are displayed.
Optional arguments:
  • key specifies a string or list of strings to validate if it is a Teradata reserved keyword.
  • raise_error specifies whether to raise exception or not.

    When set to True, an exception is raised, if specified "key" is a Teradata reserved keyword, otherwise not.

    The default value is False.

Example Setup

>>> from teradataml import list_td_reserved_keywords

Example 1: List all available Teradata reserved keyword

>>> list_td_reserved_keywords()
         restricted_word
       0             ABS
       1         ACCOUNT
       2            ACOS
       3           ACOSH
       4      ADD_MONTHS
       5           ADMIN
       6             ADD
       7     ACCESS_LOCK
       8    ABORTSESSION
       9           ABORT

Example 2: Validate if keyword "account" is a Teradata reserved keyword or not

>>> list_td_reserved_keywords("account")
True

Example 3: Validate and raise exception if keyword "account" is a Teradata reserved keyword

>>> list_td_reserved_keywords("account", raise_error=True)
TeradataMlException: [Teradata][teradataml](TDML_2121) 'account' is a Teradata reserved keyword.

Example 4: Validate if the list of keywords contains Teradata reserved keyword or not

>>> list_td_reserved_keywords(["account", 'add', 'abc'])
True

Example 5: Example 5: Validate and raise exception if the list of keywords contains Teradata reserved keyword

>>> list_td_reserved_keywords(["account", 'add', 'abc'], raise_error=True)
TeradataMlException: [Teradata][teradataml](TDML_2121) '['ADD', 'ACCOUNT']' is a Teradata reserved keyword.