User-defined functions

A user-defined function is a program that can be called like any built-in functions.

Db2 for i supports external functions, SQL functions, and sourced functions. An external function can be any system ILE program or service program. An SQL function is defined entirely in SQL and can contain SQL statements, including SQL control statements. A sourced function is built over any built-in or any existing user-defined function. You can create a scalar function or a table function as either an SQL function or an external function.