ENFORCE
For more information about how LOADPLUS handles constraint checking, see Referential-and-check-constraints .
Additional considerations
The following considerations apply to the ENFORCE option:
- For an SQLAPPLY load:
- If LOADPLUS invokes DSNUTILB, LOADPLUS passes ENFORCE CONSTRAINTS regardless of the value that you specify.
- For all other SQLAPPLY load jobs, LOADPLUS ignores this option because Db2 checks all constraints during apply processing.
- If the ENFORCE option that is in effect causes LOADPLUS to not check for all referential and check constraint violations defined on the table space, LOADPLUS places the affected table spaces in CHKP status if CHECKPEND YES is in effect. For more information about when LOADPLUS sets and resets CHKP status, see Considerations-for-CHKP-status.
Specifying the default
You can specify the default for the ENFORCE command option in your installation options module by using the ENFORCE installation option. LOADPLUS was shipped with a default value of CHECK for this option. The command option overrides the default that is in the installation options module.
CONSTRAINTS
When you specify CONSTRAINTS, LOADPLUS checks the rows to be loaded for violations of both Db2-defined check constraints and referential constraints, if any constraints exist. LOADPLUS discards any rows that violate constraints.
To check referential constraints, you must have XBM or SUF installed and available to LOADPLUS. For information about additional requirements and restrictions when checking referential constraints, see Referential-constraints-and-informational-referential-constraints.
Additional considerations
Note the following additional information about ENFORCE CONSTRAINTS:
- If LOADPLUS cannot enforce all constraints defined on the table that you are loading and CHECKPEND YES is in effect, LOADPLUS sets CHKP status on that table.
- If you specify FORMAT BMCUNLOAD, LOADPLUS does not enforce check constraints and issues message BMC50138I. LOADPLUS sets CHKP status if check constraints are defined on the table that you are loading and CHECKPEND YES is in effect.
- When invoking DSNUTILB, LOADPLUS passes this option to the IBM Db2 LOAD utility for processing unless you also specify INFORI YES.
INFORI | This option tells LOADPLUS whether to enforce informational referential constraints when enforcing all constraints.
|
RI
When you specify RI, LOADPLUS checks the rows to be loaded for violations of Db2-defined referential constraints only, if any constraints exist. LOADPLUS discards any violating rows.
To check referential constraints, you must have XBM or SUF installed and available to LOADPLUS.
SmartSwitch will not switch to BMC AMI Load if RI structures are being processed.
Restriction
This option is not valid when LOADPLUS invokes DSNUTILB:
- For an SQLAPPLY load, LOADPLUS passes ENFORCE CONSTRAINTS.
- Otherwise, LOADPLUS issues message BMC50178E and terminate.
INFORI | This option tells LOADPLUS whether to enforce informational referential constraints when enforcing other referential constraints.
|
CHECK CONSTRAINTS
When you specify CHECK CONSTRAINTS, LOADPLUS checks the rows to be loaded for violations of Db2-defined check constraints only, if any constraints exist. LOADPLUS discards any violating rows.
SmartSwitch will not switch to BMC AMI Load if RI structures are being processed.
Restrictions
The following restrictions apply to the ENFORCE CHECK CONSTRAINTS option:
- If you specify FORMAT BMCUNLOAD, LOADPLUS ignores this option and issues a message BMC50138I. LOADPLUS sets CHKP status if there are check constraints on the table that you are loading and CHECKPEND YES is in effect.
- This option is not valid when LOADPLUS invokes DSNUTILB:
- For an SQLAPPLY load, LOADPLUS passes ENFORCE CONSTRAINTS.
- Otherwise, LOADPLUS issues message BMC50178E and terminate.
NO
Specify NO when you do not want to verify check constraints or referential constraints during LOADPLUS processing. When you specify NO, LOADPLUS loads all rows regardless of whether they violate check constraints or referential constraints. If CHECKPEND YES is in effect, LOADPLUS automatically sets the object status to CHKP.
When invoking DSNUTILB:
- For an SQLAPPLY load, LOADPLUS passes ENFORCE CONTRAINTS.
- Otherwise, LOADPLUS passes this option to the Db2 LOAD utility for processing.