请求表操作表:用户信息表(person_tab)
种类:Before delete
功能描述:关联删除所有外键指向该表的数据行,删除与人员关连的数据行
操作表:
日历提示信息表(calendarNote_tab)
公文基础信息表(documentBaseInfo_tab)
AB角工作分工信息表(divideWork_tab)
公文督办基础信息表(superviseBaseInfo_tab)
人员在岗信息表(guardInfo_tab)
周工作计划信息表(planOfWeek_tab)
/***************************************************/ create or replace TRIGGER DelPerson BEFORE DELETE ON person_tab FOR EACH ROW BEGIN delete from calendarNote_tab where calendarNote_tab.c_userId =:old.p_userId; delete from documentBaseInfo_tab where documentBaseInfo_tab.dbi_publishUserId =:old.p_userId; delete from superviseBaseInfo_tab where superviseBaseInfo_tab.sbi_enterUserId =:old.p_userId; delete from divideWork_tab where divideWork_tab.dw_enterUserId=:old.p_userId; delete from guardInfo_tab where guardInfo_tab.gi_userId=:old.p_userId; delete from planOfWeek_tab where planOfWeek_tab.pw_userId=:old.p_userId; END; |
请求表操作表:组织结构信息表(department_tab)
种类: Before delete
功能描述:关联删除所有外键指向该表的数据行,删除与部门有关的数据行
操作表:用户信息表(person_tab)
/***************************************************/ create or replace TRIGGER Deldepartment BEFORE DELETE ON DEPARTMENT_TAB FOR EACH ROW BEGIN delete from person_tab where person_tab.p_departmentId =:old.dm_id; END; |
最新内容请见作者的GitHub页:http://qaseven.github.io/