Oracle Delete FOREIGN KEY constraint disable constraint enable constraint
Execute the following SQL-generated statement
Delete all foreign KEY constraints
SQL code
Select ' '| | table_name| | ' '| | Constraint_name| | ' ; ' from where constraint_type='R'
Disable all FOREIGN KEY constraints
SQL code
Select ' '| | table_name| | ' '| | Constraint_name| | ' ; ' from where constraint_type='R'
Enable all foreign KEY constraints
SQL code
Select ' '| | table_name| | ' '| | Constraint_name| | ' ; ' from where constraint_type='R'
Main Table mantis_user and child table Mantis_user_organ
--Create FOREIGN key (default option)
ALTER TABLE ADD CONSTRAINT fk_mantis_user_organ_org FOREIGNKEY (org_id) REFERENCES Mantis_user (ID);
--delete foreign KEY constraint
ALTER TABLE DROP CONSTRAINT fk_mantis_user_organ_org;
Reference article:http://qindingsky.blog.163.com/blog/static/312233620109292562735/http://blog.csdn.net/laodao1/article/details/6446953
Oracle Delete FOREIGN KEY constraint disable constraint enable constraint