17.10 - Custom Clause - Advanced SQL Engine - Teradata Database

Teradata Vantageā„¢ - SQL External Routine Programming

Advanced SQL Engine
Teradata Database
Release Number
Release Date
July 2021
Content Type
Programming Reference
Publication ID
English (United States)

You can specify Custom clauses when invoking a table operator to customize and make the operator polymorphic. Custom clauses are similar in principle to the way GROUP BY and HAVING clauses apply to aggregation. The input is a list of key-value pairs. The contract function can validate the Custom clauses and return a syntax error if the Custom clauses are invalid. The clauses can contain names and literal values. For the literal value custom argument clauses, the type information is interpreted using the current syntaxer rules. For example, 1 is a BYTEINT and '1' is a VARCHAR(1) CHARACTER SET x, where x is the character set of the creator of the table operator. You cannot use a Teradata reserved word for a key, and the total length of custom clauses must be at most 64K bytes.

You can use the following functions to access information related to the Custom clauses, such as Type and Value.

  • FNC_TblOpGetCustomKeyCount
  • FNC_TblOpGetCustomKeyInfoOf
  • FNC_TblOpGetCustomKeyInfoAt
  • FNC_TblOpGetCustomValuesOf

For details about these functions, see Table Operator Interface.