15.00 - Chapter 28 User-Defined Functions - Teradata Database

Teradata Database SQL Functions, Operators, Expressions, and Predicates

Product
Teradata Database
Release Number
15.00
Content Type
Programming Reference
Publication ID
B035-1145-015K
Language
English (United States)
Last Update
2018-09-24

Teradata Database supports two types of user-defined functions (UDFs) that allow you to extend SQL by writing your own functions:

  • SQL UDFs
  • SQL UDFs allow you to encapsulate regular SQL expressions in functions and then use them like standard SQL functions.

  • External UDFs
  • External UDFs allow you to write your own functions in the C, C++ or the Java programming language, install them on the database, and then use them like standard SQL functions. For details on external UDFs, see SQL External Routine Programming.

    UDFs can be of the following types:

  • Scalar
  • A scalar UDF can appear almost anywhere a standard SQL scalar function can appear.

  • Aggregate or Window Aggregate
  • A window aggregate UDF is an aggregate UDF with a window specification applied to it. An aggregate UDF can appear almost anywhere a standard SQL aggregate function can appear.

  • Table
  • A table UDF can only appear in the FROM clause of an SQL SELECT statement.