Using UDFs in SQL statements

Scalar and column user-defined functions (UDFs) can be called within an SQL statement almost everywhere an expression is valid. Table UDFs can be called in the FROM clause of a SELECT statement. Listed here are a few restrictions on the use of UDFs.

  • 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)).