Scalable Database Server, HiRDB Version 8 Description
A characteristic of databases is that value ranges, conditions, and other limitations are often imposed on the data contained in the tables. For example, when product information is stored in a database, the product cost cannot be a negative value. This means that there must not be negative product cost values in the database, which suggests that these values should be checked when they are inserted or updated. A check constraint is a function that maintains the integrity of table data by checking a constraint condition when data is inserted or updated and by suppressing operations on data that does not satisfy the condition. In this manual, a table for which a check constraint has been defined is called a check constraint table.
Note that execution of a utility may make it impossible to guarantee the integrity of data in a check constraint table. When this occurs, the check constraint table is placed in check pending status. For details about check pending status, see 5.9 Check pending status.
For details about check constraints, see the HiRDB Version 8 Installation and Design Guide.
To define a check constraint, you first specify CHECK with CREATE TABLE of a definition SQL, and then use a search condition to specify the constraint condition for the table value To use the check pending status, specify USE in the pd_check_pending operand or omit specification of the pd_check_pending operand.
When you use a data manipulation SQL to update, add, or delete data in a check constraint table, HiRDB performs checking when the SQL is executed in order to guarantee data integrity. However, if you perform certain data operations with the utilities listed below, HiRDB may no longer be able to guarantee data integrity.
If you do perform any of these data operations, you must verify the integrity of the data. For details about how to verify data integrity, see the HiRDB Version 8 Installation and Design Guide. When USE is specified in the pd_check_pending operand, the referencing table is placed in check pending status if you perform any of these data operations.
All Rights Reserved. Copyright (C) 2007, Hitachi, Ltd.