Use the list_td_reserved_keywords() function to validate if the specified string is Teradata reserved keyword or not. Accepts a list of strings as an argument.
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.