Writing UDFs as SQL functions

An SQL function is a user-defined function (UDF) that you define, write, and register using the CREATE FUNCTION statement.

An SQL function is written in the SQL procedural language, called SQL PL, and its definition is completely contained within one CREATE FUNCTION statement. The creation of an SQL function causes the registration of the UDF, generates the executable code for the function, and defines to the database the details of how parameters are passed.