Specifying the field procedure

To name a field procedure for a column, use the FIELDPROC clause of the CREATE TABLE or ALTER TABLE statement, followed by the name of the procedure and, optionally, a list of parameters.

You cannot use a field procedure on a ROWID or DATALINK column of a table or on any column having values generated by IDENTITY or ROW CHANGE TIMESTAMP. However, you can specify it for other columns in the same table.

The optional parameter list that follows the procedure name is a list of constants, enclosed in parentheses, called the literal list. The literal list is converted by DB2® into a data structure called the field procedure parameter value list (FPPVL). The FPPVL is passed to the field procedure during the field-definition operation. At that time, the procedure can modify it or return it unchanged. The output form of the FPPVL is called the modified FPPVL. It is stored in the DB2 QSYS2.SYSFIELDS catalog table as part of the column description. The modified FPPVL is passed again to the field procedure whenever that procedure is invoked for field-encoding or field-decoding.