Validation routines

Validation routines are assigned to a table by the VALIDPROC clause of the CREATE TABLE and ALTER TABLE statement. A validation routine receives an entire row of a base table as input. The routine can return an indication of whether to allow a subsequent INSERT, UPDATE, DELETE, FETCH, or SELECT operation.

Begin program-specific programming interface information.
Typically, a validation routine is used to impose limits on the information that can be entered in a table; for example, allowable salary ranges, perhaps dependent on job category, for the employee sample table.

Although VALIDPROCs can be specified for a table that contains a LOB or XML column, the LOB or XML values are not passed to the validation routine. The LOB indicator column takes the place of the LOB column, and the XML indicator column takes the place of the XML column. You cannot use VALIDPROC on a table if the table contains a column name that is longer than 18 EBCDIC bytes.

The return code from a validation routine is checked for a 0 value before any insert, update, or delete is allowed.

End program-specific programming interface information.