oracle、DB2、Informix常用约束语句

 alter table student disable constraint fk_student; --oracle
 
 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 

你可能感兴趣的:(DB)