本文主要是介绍oracle、DB2、Informix常用约束语句,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
alter table student disable constraint fk_student; --oracleALTER 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
这篇关于oracle、DB2、Informix常用约束语句的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!