The CREATE FUNCTION statement defines a user-defined function at the current server. The following types of functions can be defined:
The function is written in a programming language such as C or Java(TM) and returns a scalar value. The external program is referenced by a function defined at the current server along with various attributes of the function. See CREATE FUNCTION (External Scalar).
The function is written in a programming language such as C or Java and returns a set of rows. The external program is referenced by a function defined at the current server along with various attributes of the function. See CREATE FUNCTION (External Table).
The function is implemented by invoking another function (built-in, external, sourced, or SQL) that already exists at the current server. A sourced function can return a scalar result, or the result of an aggregate function. See CREATE FUNCTION (Sourced). The function inherits attributes of the underlying source function.
The function is written exclusively in SQL and returns a scalar value. The function body is defined at the current server along with various attributes of the function. See CREATE FUNCTION (SQL Scalar).
The function is written exclusively in SQL and returns a set of rows. The function body is defined at the current server along with various attributes of the function. See CREATE FUNCTION (SQL Table).
(C) Copyright IBM Corporation 1992, 2006. All Rights Reserved.