REM *************************************************************************** REM Hand-carved package body for VIEW USAGE created on 23-FEB-99 REM *************************************************************************** CREATE OR REPLACE PACKAGE BODY cihvou IS sac_type constant varchar2(6) := 'VOU'; pac_type constant varchar2(6) := 'CLA'; --======================== PRE-PROCESS (INS,UPD) ============================-- PROCEDURE pre_process(operation varchar2,id number, pl in out NOCOPY cioview_usage.data) IS BEGIN -- Access rights for view usage derive from the application module -- Initialize unassigned properties with default values on INSERT if operation = 'INS' then pl.v.element_type_name := sac_type; pl.i.element_type_name := true; end if; END; --======================== PRE-PROCESS (DEL,SEL) ============================-- PROCEDURE pre_process(operation varchar2,id number) IS BEGIN -- Access rights for view usage derive from the application module null; END; --===================== POST-PROCESS (INS,UPD,SEL) ==========================-- PROCEDURE post_process(operation varchar2,id number, pl cioview_usage.data) IS BEGIN if operation in ('INS', 'UPD') then --Maintain the out_of_sync_flag for a corresponding file_usage -- (pac_reference set by triggers so only available in post-process ciheoc.maintain_sync_flag(pl.v.application_module_reference); if pl.v.name is not null then rmman.log_change('CIHAMCAMCE_UNIQUE_NAME',pl.v.id); end if; end if; END; --========================= POST PROCESS (DEL, LCK) =========================-- PROCEDURE post_process(operation varchar2,id number) IS dummy number; error_count number := 0; CURSOR file_c(irid_ref number) IS select pac_reference cla from ci_view_usages where irid = irid_ref; BEGIN FOR file_rec IN file_c(post_process.id) LOOP if operation = 'DEL' then --Maintain the out_of_sync_flag for a corresponding file_usage ciheoc.maintain_sync_flag(file_rec.cla); end if; if operation = 'LCK' then --And lock the corresponding Primary Access File cihamc.on_lock(file_rec.cla); end if; END LOOP; END; --================================== END ====================================-- -- -- Package instantiation block -- BEGIN is_installed := true; END; /