User-defined functions

A user-defined function (UDF) is user-supplied code that is run by the Netezza Performance Server system in response to SQL invocation syntax.

UDFs provide new types of data analysis actions that are not currently available with the built-in functions such as upper(), sqr(), or length(). A user-defined function is a scalar function; that is, it returns one value.

You can use a UDF invocation anywhere inside a SQL statement where you can use a built-in function, which includes restrictions (WHERE clauses), join conditions, projections (select from lists), and HAVING conditions. A UDF can accept zero or more input values but produces one output value. Input values to a UDF can be literals, column references, or expressions. The data types of inputs and output must be Netezza Performance Server built-in data types.