DB2 Version 9.7 for Linux, UNIX, and Windows

Default values and named arguments promote flexibility for creating and calling procedures and functions

Starting in Version 9.7, you can create procedures and specify default values for parameters. When calling procedures, arguments can be assigned to parameters by name, allowing you to pass named arguments in any order.

Starting with Version 9.7 Fix Pack 2, the features of default values and named arguments has been extended to user-defined functions (UDFs).

With default parameter values defined in the procedure or UDF, and the ability to invoke a procedure or UDF with named arguments, you now have the following options when calling the procedure or UDF:

These enhancements allow for replacing an existing procedure or UDF with added parameters using defaults such that existing invocations of the procedure or UDF do not need to be changed.

You can use the defaultparam.db2 sample program to learn how to use this feature.

Examples