2 1 3 Validation Usage

LANSA Technical

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:

Always apply rule (ADD)

Rule is always applied when information is added (inserted) to the database.

Apply when field is used (ADDUSE)

Rule is only applied when the field is actually specified in the INSERT command being executed.

Never apply rule

Do not apply rule when inserting to the file.

 

When updating

Mandatory. Default= Always apply rule (CHG)

Specify database operation when the rule is to be performed.

Rules

Allowable values are:

Always apply rule (CHG)

Rule is always applied when information is changed (updated) in the database.

Apply when field is used (CHGUSE )

Rule is only applied when the field is actually specified in the UPDATE command being executed.

Never apply rule

Do not apply rule when updating the file.

 

When deleting

Mandatory. Default= Never apply rule

Specify database operation when the rule is to be performed.

Rules

Allowable values are:

Always apply rule (DLT)

Rule is always applied when information is deleted (removed) from the database.

Never apply rule

Do not apply rule when deleting from the file.

 

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.

Also See

2.1.4 Define Rules (by type)

Ý 2.1 Rule Definitions