![]() | |
|
Routines are database objects that can encapsulate programming and database logic that can be invoked like a programming sub-routine from a variety of SQL interfaces. Routines can be system-defined, which means that they are provided with the product, or user-defined, which means that users can create them. Routines can be implemented using SQL statements, a programming language, or a mix of both. Different types of routines provide different interfaces that can be used to extend the functionality of SQL statements, client applications, and some database objects.
Built-in routines are built into the code of the DB2 database manager. These routines are strongly typed and perform well because their logic is native to the database code. These routines are found in the SYSIBM schema. Some examples of built-in scalar and aggregate functions include:
Built-in scalar functions: +, -, *, /, substr, concat, length, char, decimal, days
Built-in aggregate functions: avg, count, min, max, stdev, sum, variance
Built-in functions comprise most of the commonly required casting, string manipulation, and arithmetic functionality. You can immediately use these functions in your SQL statements.
![]() ![]() ![]() ![]() ![]() ![]() |
![]() |
![]() |