2.1.3 Validation Usage
When inserting
Mandatory. Default= Always apply rule (ADD)
Specify database operation when the rule is to be performed.
Rules
Allowable values are:
|
When updating
Mandatory. Default= Always apply rule (CHG)
Specify database operation when the rule is to be performed.
Rules
Allowable values are:
|
When deleting
Mandatory. Default= Never apply rule
Specify database operation when the rule is to be performed.
Rules
Allowable values are:
|
Tips & Techniques
- Most commonly used entries are ADD, CHG and CHGUSE.
- Use of DLT by itself is a common and a very powerful rule mechanism.
- If ADDUSE is specified, ensure that the default value of the field is a valid database value.
- Use caution when specifying CHGUSE with a rule that involves multiple fields, because the check will only be done when the field linked to the rule is specified on an UPDATE command, and not done when it is omitted, regardless of whether or not any of the other fields referenced in the rule are specified.
- When creating a rule, ensure that it does not indirectly interfere with a trigger. For more information, refer to Triggers - Some Do's and Don'ts.
Also See