在删除表1的某条记录之后,删除表2与之相关的数据
CREATE OR REPLACE TRIGGER tr_del AFTER DELETE ON 表1 REFERENCING OLD AS "OLD" NEW AS "NEW" FOR EACH ROW ENABLE
BEGIN
delete from 表2 where 表2字段 = :OLD.表1字段;
END;
备注:会忽略主外键关系
在删除表1的某条记录之后,删除表2与之相关的数据
CREATE OR REPLACE TRIGGER tr_del AFTER DELETE ON 表1 REFERENCING OLD AS "OLD" NEW AS "NEW" FOR EACH ROW ENABLE
BEGIN
delete from 表2 where 表2字段 = :OLD.表1字段;
END;
备注:会忽略主外键关系