Table Check Constraints List Screen

On the Table Check Constraints List screen, you can name sets of values that define constraints for a table by entering U in the Check Const field of the Table Create, Alter, or Template screen.
carcudb2
On the Table Check Constraints List screen, you can name sets of values that define constraints for a table by entering U in the Check Const field of the Table Create, Alter, or Template screen.
If you are creating, altering, or templating an MQT, and you have specified Initially Deferred in the Data field, the Check Const field is unavailable. DB2 does not support check constraints for MQTs. Initially Deferred is the default value (unless overridden by object definition defaults).
The current table name appears in the Check Constraints for Table (display only) field. The constraints appear in the Constraint Name column.
To specify the action you want to take for the current line, specify a value in the S column as follows:
  • (blank)
    Creates DDL to apply this check constraint to the current table. All check constraints in the list are active if the Check Const field is set to Y on the Table Create, Alter, or Template screen. This is the default.
  • C
    Creates a new check constraint (valid on first line only). When you specify the check constraint name and press Enter, an SQL Editor session is opened where the check constraint text is entered.
  • S
    Edits the check constraint. An edit session is opened where the check constraint text is entered.
  • D
    Deletes the check constraint. If the constraint already exists for the table, it is dropped when the alteration DDL is generated. If not, it is marked as deleted in the display, and no DDL is generated. During the current edit session, a check constraint marked as deleted can be restored using the U command.
  • U
    Undeletes a check constraint that was marked with a D. Not valid after exiting the Table Check Constraints List screen.
  • R
    Resets the text for this check constraint to the value on the Table Check Constraints List screen at the beginning of the edit session. Valid only for pre-existing check constraint names.
SQL Editor Screen
The SQL Editor screen is where you enter and save the DDL to be associated with a check constraint name on the Table Check Constraints List screen. The DDL you enter here is inserted as a CHECK clause to create or alter the table.
Enter SQL Editor line commands in the line command area. In the text area enter the DDL to associate with the check constraint name being edited. Press F3 (end) to save the text and return to the Table Check Constraints List screen.