Scalar and column UDFs can be called within an SQL statement almost
everywhere that an expression is valid. Table UDFs can be called in the FROM
clause of a SELECT. There are a few restrictions of UDF usage, however.
- UDFs and system generated functions cannot be specified in check constraints.
Check constraints also cannot contain references to some built-in functions
that are implemented by the system as UDFs.
- External UDFs, SQL UDFS and the built-in functions DLVALUE, DLURLPATH,
DLURLPATHONLY, DLURLSCHEME, DLURLCOMPLETE, and DLURLSERVER cannot be referenced
in an ORDER BY or GROUP BY clause, unless the SQL statement is read-only and
allows temporary processing (ALWCPYDTA(*YES) or (*OPTIMIZE)).