??????????????:????????(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;