Oracle Constraints…
We can add, drop, enable and disable constraints in the Oracle…
Syntax for adding a constraint..
ALTER TABLE table
ADD [CONSTRAINT constraint] type (column);
e.g.
ALTER TABLE EMPLOYEE
ADD CONSTRAINT emp_manager_fk
FOREIGN KEY(manager_id) REFERENCES employee(employee_id)
Syntax for dropping a constraint…
ALTER TABLE EMPLOYEE
DROP CONSTRAINT emp_manager_fk
Syntax for enabling and disabling a constraint…
ALTER TABLE EMPLOYEE
DISABLE CONSTRAINT emp_manager_fk
ALTER TABLE EMPLOYEE
ENABLE CONSTRAINT emp_manager_fk
No comments:
Post a Comment