Adding a Check Constraint

Previous
Previous
Next
Next

You can use Object Browser to add a constraint to a table after it has been created. In the personal_info table, you might want to check that the number of dependents claimed is always greater than 0. For information about the check constraint, see "Check Constraint".

To add a check constraint:

  1. Log in to the Database Home Page. See "Logging in to the Database Home Page".

  2. On the Database Home Page, click the Object Browser icon.

  3. In the Object list, select Tables then click the personal_info table that you previously created.

  4. Click the Constraints tab.

  5. Click the Create button.

  6. On the Add Constraint page, use the following information to complete the page.

    Constraint Name: PERSONAL_INFO_CHECK_CON
    Constraint Type: Check
    Constraint on Column: DEPENDENTS_CLAIMED(NUMBER)
    Constraint Expression: > 0
  7. Click the Next button.

  8. Click the Finish button to complete the action.