A user-defined function is a function that you define to DB2. Once defined, it can be referenced in SQL statements. User-defined functions are new objects in DB2 Universal Database for OS/390 Version 6.
A user-defined function can be either a sourced function or an external function. A sourced function is a function that is based on an existing built-in or user-defined function. An external function is a function for which the body of the function is written in a programming language that takes scalar argument values and produces a scalar result for each invocation.
A scalar function is a function that produces a single value from an input value. A table function is a function that produces a table of values from a set of input values.