外键表的级联删除(ON DELETE CASCADE的用法)
实现两张表的级连删除呢?
重新建立PERSON的外键,加上ON DELETE CASCADE选项试一下:
SQL> alter table person drop CONSTRAINT FK_PERSON1;
表已更改。
SQL>ALTER TABLE PERSON ADD (CONSTRAINT FK_PERSON1 FOREIGN KEY (PROFESSION)
REFERENCES PERSONPROFESSION (PROFESSIONID) ON DELETE CASCADE);