Example: Deleting a Table Constraint

You can delete constraints from a table with SQL Developer. Deleting a table constraint may cause the deletion of other constraints. For example, if you delete the primary key constraint from a table (the parent table) that is referenced in a foreign key constraint in another table (the child table), then the foreign key constraint in the child table is also deleted through a cascading delete mechanism.

In this example, you delete the check constraint that you created for the purchase_orders table in "Example: Adding a New Table Constraint".

To delete a constraint from the PURCHASE_ORDERS table:

  1. In SQL Developer, navigate to the PURCHASE_ORDERS table in the HR schema, following the instructions in "Viewing Tables".
  2. Right-click the PURCHASE_ORDERS table and select Constraint, and then Drop.

    The Drop dialog box appears.

  3. In the Constraint field, select PO_CHECK_RCVD_DATE.
  4. Click Apply.

    A confirmation message appears advising that the constraint has been dropped.

  5. On the PURCHASE_ORDERS tab in the object pane, click the Constraints subtab. The PO_CHECK_RCVD_DATE constraint no longer appears in this table.

See Also: