January 2005
Beginner to intermediate
928 pages
22h 14m
English
DB2 provides built-in functions that allow you to manipulate your data within an SQL statement. For example, the year function can retrieve the year of a timestamp column, as shown here.
db2 select year(current timestamp) from sysibm.sysdummy1
1
-----------
2005
In addition to built-in functions, DB2 allows you to create your own functions. These user-defined functions (UDFs) allow you to simplify database application development by moving some of the logic to the database. A UDF takes zero to many input parameters and returns a value, a row or a table. To create a UDF, use the CREATE FUNCTION statement.
UDFs can be classified as follows.
Sourced functions: These functions are created on top of DB2 built-in functions. ...
Read now
Unlock full access