create or replace trigger TRG_v_budget_report_sync
after insert on v_budget_report_sync
FOR EACH ROW
BEGIN
if inserting then
update v_budget_report_sync c set c.v_oa_budget_id = (select nvl(v_oa_budget_sync.v_oa_budget_id,'') oabudgetid
from v_oa_budget_sync vbr
where v_oa_budget_sync.year_sync = new.
and v_oa_budget_sync.orgid_sync = 1
and v_oa_budget_sync.operatorid_sync = 1
and v_oa_budget_sync.btype_sync = 1
and v_oa_budget_sync.itemdictid_sync = 1
and v_oa_budget_sync.month_sync = 1
) where c.v_budget_report_id = new.v_budget_report_id;
end if;
commit;
END;
轉載請註明出處,本文鏈接:https://www.uj5u.com/shujuku/93791.html
標籤:PostgreSQL
