Online Documentation for SQL Manager for DB2

Checks


A Check specifies an expression producing a Boolean result which new or updated rows must satisfy for an insert or update operation to succeed. Expressions evaluating to TRUE or UNKNOWN succeed. Should any row of an insert or update operation produce a FALSE result an error exception is raised and the insert or update does not alter the database. A check constraint specified as a column constraint should reference that column's value only, while an expression appearing in a table constraint may reference multiple columns.

 

Table checks are managed within the Constraints tab of Table Editor.

 

 

Creating Checks

 

To create a new check:

  • open the table in Table Editor;
  • proceed to the Constraints tab, and then to the Check tab there;
  • right-click the tab area and select the New Check context menu item;
  • define the check properties using the Check Editor dialog.

 

Viewing Checks

 

To view an existing check:

  • open the table in Table Editor;
  • proceed to the Constraints tab, and then to the Check tab there;
  • right-click the check and select the View Check context menu item, or simply double-click the check;
  • view the check properties using the Check Editor dialog.

 

Dropping Checks

 

To drop a check:

  • open the table in Table Editor;
  • proceed to the Constraints tab, and then to the Check tab there;
  • right-click the check and select the Drop Check context menu item;
  • confirm dropping in the dialog window.