Teradata Database supports two types of user-defined functions (UDFs) that allow you to extend SQL by writing your own functions:
SQL UDFs allow you to encapsulate regular SQL expressions in functions and then use them like standard SQL functions.
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:
A scalar UDF can appear almost anywhere a standard SQL scalar function can appear.
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.
A table UDF can only appear in the FROM clause of an SQL SELECT statement.