13.2.2 Facility for changing check pending status forcibly

Organization of this subsection
(1) Overview of function
(2) Execution unit of the facility for changing check pending status forcibly
(3) Forced setting of check pending status
(4) Forced release of check pending status

(1) Overview of function

The facility for changing check pending status forcibly changes the check pending status; this facility does not check the integrity of referential constraints or check constraints. This facility provides two functions, forced setting of check pending status and forced release of check pending status.

Forced setting of check pending status
This function forces a table into check pending status. You specify -k set to use this function.
Forced setting of check pending status is used in the following cases:
  • The pd_check_pending operand value in the system definition was changed from NOUSE to USE and the integrity of referential constraints or check constraints is not clear.
  • In a system in which the pd_check_pending operand was omitted in the system definition, HiRDB was upgraded to version 07-03 or later and the integrity of referential constraints or check constraints is not clear.
  • Table manipulation by the user must be regulated temporarily.
  • Because a constraint violation was detected during integrity checking, the check pending status was released forcibly, the data resulting in the constraint violation during SQL execution was corrected, and now integrity checking is to be performed again.
Forced release of check pending status
This function forces a table into the non-check pending status (releases the check pending status). You specify -k release to use this function.
Forced release of check pending status is used in the following cases:
  • The check pending status needs to be forcibly released in order to resume operations, such as when there is no need to perform integrity checking because the user has confirmed the integrity of the constraints.
  • A row resulting in a violation of a referential constraint is to be corrected by using SQL statements to update or delete a referencing table's foreign key.
  • A row resulting in a violation of a check constraint is to be corrected using SQL statements.

(2) Execution unit of the facility for changing check pending status forcibly

The facility for changing check pending status forcibly can be executed by table to update all referential constraints and check constraints defined for a table, or by constraint to update only an individual constraint.

When the facility for changing check pending status forcibly is executed, information about the check pending status in data dictionary tables changes. The following table lists the locations in data dictionary tables where the check pending status changes.

Table 13-16 Locations in data dictionary tables where check pending status changes

Exe unit-c option specTable constraintLocations in data dictionary table where check pending status changes
Ref constCheck constSQL_TABLES tableSQL_REFERENTIAL_CONSTRAINTS tableSQL_CHEKS table
CHECK_PEND columnCHECK_PEND2 columnCHECK_PEND columnCHECK_PEND2 column
By tableNot applicableNoYes--Y--Y#1
YesNoY--Y#1--
YesYesYYY#1Y#1
By constraintRef constYesNoY--Y#2--
YesYesY--Y#2--
Check constraintNoYes--Y--Y#2
YesYes--Y--Y#2
Legend:
Exe unit: Execution unit
-c option spec: -c option specification
Ref const: Referential constraint
Check const: Check constraint
Y: Check pending status changes.
--: Check pending status remains unchanged (the current status is maintained).
#1
The check pending status of all referential constraints or check constraints defined for the table is changed.
#2
The check pending status of only the constraint specified in the -c option is changed.

The following table lists the locations of table information in an RDAREA where check pending status changes.

Table 13-17 Locations of table information in an RDAREA where check pending status changes

Execution unit-c option specTable constraintLocations of table information in an RDAREA where check pending status changes
Referential constraintCheck constraintReferential constraint statusCheck constraint status
By tableNot applicableNoYes--Y
YesNoY--
YesYesYY
By constraintReferential constraintYesNoY--
YesYesY--
Check constraintNoYes--Y
YesYes--Y
Legend:
-c option spec: -c option specification
Y: Check pending status changes.
--: Check pending status remains unchanged (the current status is maintained).

(a) By table

When the facility is executed by table, it changes all the defined referential constraints or check constraints. You specify the -t option to execute the facility by table.

You use execution by table in the following case:

(b) By constraint

The facility changes only one referential constraint or check constraint defined for the table. You specify the -c option to execute the facility by constraint.

You use execution by constraint in order to change the check pending status for an individual constraint.

(3) Forced setting of check pending status

This function places a table, constraints, and RDAREAs in check pending status.

(4) Forced release of check pending status

This function releases a table, constraints, and RDAREAs from check pending status. The setting (whether or not the check pending status can be released) depends on the execution unit of pdconstck and the check pending status of the table, constraints, and RDAREAs. The following provides the details for each execution unit.

Forced release of check pending status by table
When pdconstck is executed by table, it unconditionally places the target table, constraints, and RDAREAs in non-check pending status.
Forced release of check pending status by constraint
When pdconstck is executed by constraint, it places the constraint specified in the -c option in non-check pending status. Depending on the check pending status of other constraints, the check pending status of the table or RDAREAs may not change. The table below shows the changes in the check pending status.

Table 13-18 Changes in the check pending status by constraint (forced release of check pending status)

ConditionCheck pending status (table and RDAREA)
A constraint that is not specified in the -c option is definedThere is a constraint in check pending statusNo change
All constraints are in non-check pending statusNon-check pending status
Only the constraint specified in the -c option is defined for the tableNon-check pending status