Adding a Foreign Key Constraint

Previous
Previous
Next
Next

You can use Object Browser to add a foreign key constraint on a column in one table to a column in a reference table. This ensures that a value inserted in a column matches a valid value in the reference table. For information about the foreign key constraint, see "Foreign Key Constraint".

To add a foreign key 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, select Foreign Key for the Constraint Type. Use following information to complete the page:

    Constraint Name: PERSONAL_INFO_FKEY
    Foreign Key Column: EMPLOYEE_ID
    Reference Table Name: EMPLOYEES
    Reference Table Column List: EMPLOYEE_ID

    Do not check the Preserve Case box. Check the On Delete Cascade box.

  7. Click the Next button.

  8. Click the Finish button to complete the action.