數據庫多個觸發器的連續執行

---- 1:部門中間表序列觸發器
create or replace trigger MID_ORG_DEPT_TRIGGER
before insert on mid_org_dept
for each row
begin
  if (:new.mid_id is null) then
    select MID_ORG_DEPT_ID.nextval into :new.mid_id from dual;
  end if;
end;
/
----2:個人銀行賬戶中間表創建序列觸發器
create or replace trigger mid_bd_psnbankacc_trig_autoinc
before insert on mid_bd_psnbankacc
for each row
begin
  if (:new.mid_id is null) then   
    select mid_bd_psnbankacc_id.nextval into :new.mid_id from dual;
  end if;
end;
/
 ----3:個人銀行子賬戶中間表創建序列觸發器
create or replace trigger mid_bd_bankaccsub_trig_autoinc
before insert on mid_bd_bankaccsub 
for each row
begin
  if (:new.mid_id is null) then   
    select mid_bd_bankaccsub_id.nextval into :new.mid_id from dual;
  end if;
end;
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章