2 Day Developer > Managing Database Objects > Managing Tables > Adding a Foreign Key Constr...
Adding a Foreign Key Constraint |
Previous |
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:
Log in to the Database Home Page. See "Logging in to the Database Home Page".
On the Database Home Page, click the Object Browser icon.
In the Object list, select Tables then click the personal_info
table that you previously created.
Click the Constraints tab.
Click the Create button.
On the Add Constraint page, select Foreign Key for the Constraint Type. Use following information to complete the page:
PERSONAL_INFO_FKEY
EMPLOYEE_ID
EMPLOYEES
EMPLOYEE_ID
Do not check the Preserve Case box. Check the On Delete Cascade box.
Click the Next button.
Click the Finish button to complete the action.