The constraint statement specifies settings for check pending status.
When you perform data loading on a table for which check constraints or referential constraints have been defined, pdload may store data whose constraint integrity cannot be guaranteed because the utility does not check data integrity. To restrict data manipulation on a table until its integrity has been verified by pdconstck, the constraint statement places a table that is subject to data loading and referencing tables related to such a table in check pending status.
You can also specify a control statement that will prevent a table's check pending status from being changed. For details about check pending status, see the manual HiRDB Version 8 Installation and Design Guide.
constraint [pending=no] |
Specifies that when data loading is to be performed on a referencing table or check constraint table, the table's check pending status is not to be changed. For details about the default value that is assumed when this operand is omitted, see (4) Range of check pending status settings.
Specifies that when data loading is to be performed on a referenced table, the check pending status of a referencing table related to the referenced table is not to be changed. For details about the default value that is assumed when this operand is omitted, see (4) Range of check pending status settings.
Table 5-3 shows the range of check pending status settings for check constraints. Table 5-4 shows the range of check pending status settings for referential constraints.
Table 5-3 Range of check pending status settings for check constraints
Data loading execution condition | Check pending status for check constraint | |||
---|---|---|---|---|
pd_check_pending operand value in system definition | Unit of execution | Data dictionary table | Table information in RDAREA | |
SQL_TABLES table CHECK_PEND2 column | SQL_CHECKS table CHECK_PEND2 column | Check constraint status | ||
USE | Table | C | C | T# |
RDAREA | C | C | D# | |
NOUSE | Table | N | N | N |
RDAREA | N | N | N |
Table 5-4 Range of check pending status settings for referential constraints
Data loading execution condition | Table subject to data loading | |||||||
---|---|---|---|---|---|---|---|---|
pd_check_pend operand value in system define | -d option spec | Unit of exe | Referenced table | Referencing table | ||||
Check pending status of the referencing table related to referenced table | Check pending status of referencing table | |||||||
Data dictionary table | TIRDA | Data dictionary table | TIRDA | |||||
SQLTC | SQLRC | REFCS | SQLTC | SQLRC | REFCS | |||
USE | Spec'd | Table | C | C | T# | C | C | T# |
RDAREA | C | C | T# | C | C | D# | ||
Omitted | Table | N | N | N | C | C | T# | |
RDAREA | N | N | N | C | C | D# | ||
NOUSE | Spec'd | Table | N | N | N | N | N | N |
RDAREA | N | N | N | N | N | N | ||
Omitted | Table | N | N | N | N | N | N | |
RDAREA | N | N | N | N | N | N |
This subsection describes whether or not check pending status can be set for tables T1 through T5 when the pending and ref_pending operands are specified in the constraint statement.
Table 5-5 shows the table's check pending status when data loading is performed on tables T1 through T5.
Table 5-5 Table's check pending status when data loading is performed
Table subject to data loading and whether or not there are constraint definitions | Operand specification in the constraint statement | Check pending status for table | ||||||||
---|---|---|---|---|---|---|---|---|---|---|
Table name | Referential constraint | Check constraint | pend | ref_ pend | T1 | T2 | T3 | T4 | T5 | |
Referenced table | Referencing table | |||||||||
T1 | Y | N | N | Omit'd | Omit'd | ![]() | P | ![]() | ![]() | ![]() |
Spec'd | ![]() | N | ![]() | ![]() | ![]() | |||||
Spec'd | Omit'd | ![]() | P | ![]() | ![]() | ![]() | ||||
Spec'd | ![]() | N | ![]() | ![]() | ![]() | |||||
T2 | Y | Y | N | Omit'd | Omit'd | ![]() | P | P | ![]() | ![]() |
Spec'd | ![]() | P | N | ![]() | ![]() | |||||
Spec'd | Omit'd | ![]() | N | P | ![]() | ![]() | ||||
Spec'd | ![]() | N | N | ![]() | ![]() | |||||
T3 | N | Y | N | Omit'd | Omit'd | ![]() | ![]() | P | ![]() | ![]() |
Spec'd | ![]() | ![]() | P | ![]() | ![]() | |||||
Spec'd | Omit'd | ![]() | ![]() | N | ![]() | ![]() | ||||
Spec'd | ![]() | ![]() | N | ![]() | ![]() | |||||
T4 | N | N | Y | Omit'd | Omit'd | ![]() | ![]() | ![]() | P | ![]() |
Spec'd | ![]() | ![]() | ![]() | P | ![]() | |||||
Spec'd | Omit'd | ![]() | ![]() | ![]() | N | ![]() | ||||
Spec'd | ![]() | ![]() | ![]() | N | ![]() | |||||
T5 | N | N | N | Omit'd | Omit'd | ![]() | ![]() | ![]() | ![]() | ![]() |
Spec'd | ![]() | ![]() | ![]() | ![]() | ![]() | |||||
Spec'd | Omit'd | ![]() | ![]() | ![]() | ![]() | ![]() | ||||
Spec'd | ![]() | ![]() | ![]() | ![]() | ![]() |
The timing of setting check pending status for a target table subject to data loading and for referencing tables related to that target table depends on the data loading mode. Table 5-6 shows the relationship between the data loading mode and when check pending status is set.
Table 5-6 Check pending status setting timing
Data loading mode | When check pending status is set |
---|---|
Creation mode | Before data deletion processing begins |
Addition mode | Before data loading begins |
If pdload rolls back due to an error after it has set the table's check pending status, the table is still placed in check pending status because setting of the check pending status has been completed (commit is completed).