ALTER TABLE student ALTER FOREIGN KEY fk_student NOT ENFORCED; --DB2
ALTER TABLE student ADD CONSTRAINT FOREIGN KEY (college_id) REFERENCES college CONSTRAINT student_fk1; --增加外键
ALTER TABLE student DROP CONSTRAINT fk_student;--删除外键
alter table student add constraint fk_student foreign key(college_id) references college(college_id);
alter table student2 add constraint fk_student foreign key(college_id) references college(college_id);--oracle alter table student2 add constraint fk_student foreign key(college_id) references college(college_id);--db2 ALTER TABLE student ADD CONSTRAINT FOREIGN KEY (college_id) REFERENCES college CONSTRAINT student_fk1; --informix
原文链接:https://www.f2er.com/oracle/207518.html