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

Teradata® VantageCloud Lake

Deployment
VantageCloud
Edition
Lake
Product
Teradata Vantage
Published
January 2023
Language
English (United States)
Last Update
2024-04-03
dita:mapPath
phg1621910019905.ditamap
dita:ditavalPath
pny1626732985837.ditaval
dita:id
phg1621910019905

Use the list_td_reserved_keywords() function to validate if the specified string is 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 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.