rem rem $Header: L:\\\\model\\repman40\\api\\RCS\\cimch.hpb 1.1 1998/05/28 16:28:44 mfrobins Exp $ rem Rem Copyright (c) 1994 by Oracle Corporation Rem NAME Rem cimch.hpb - Rem DESCRIPTION Rem Rem RETURNS Rem Rem NOTES Rem Rem MODIFIED (MM/DD/YY) Rem aheath 09/06/94 - Creation REM *************************************************************************** REM Hand-carved package body for CHANGE HISTORY created on 26-SEP-94 REM *************************************************************************** CREATE OR REPLACE PACKAGE BODY cihmch IS -- Generic post-process routines PROCEDURE check_delete(id number); sac_type constant varchar2(6) := 'MCH'; pac_type constant varchar2(6) := 'MOD'; --======================== PRE-PROCESS (INS,UPD) ============================-- PROCEDURE pre_process(operation varchar2,id number, pl in out NOCOPY ciochange_history.data) IS BEGIN -- Access rights for change history derive from the module -- Access rights checking performed by triggers in config 4.0.9 -- ciiacc.check_access_rights(pl.v.module_reference,pac_type, -- 'UPD','SHR'); -- Validate user-defined properties if cieval.is_extended then cieval.check_element(id,pl.v.types,(operation='UPD') ,pl.v.user_defined_property_0,pl.i.user_defined_property_0 ,pl.v.user_defined_property_1,pl.i.user_defined_property_1 ,pl.v.user_defined_property_2,pl.i.user_defined_property_2 ,pl.v.user_defined_property_3,pl.i.user_defined_property_3 ,pl.v.user_defined_property_4,pl.i.user_defined_property_4 ,pl.v.user_defined_property_5,pl.i.user_defined_property_5 ,pl.v.user_defined_property_6,pl.i.user_defined_property_6 ,pl.v.user_defined_property_7,pl.i.user_defined_property_7 ,pl.v.user_defined_property_8,pl.i.user_defined_property_8 ,pl.v.user_defined_property_9,pl.i.user_defined_property_9 ,pl.v.user_defined_property_10,pl.i.user_defined_property_10 ,pl.v.user_defined_property_11,pl.i.user_defined_property_11 ,pl.v.user_defined_property_12,pl.i.user_defined_property_12 ,pl.v.user_defined_property_13,pl.i.user_defined_property_13 ,pl.v.user_defined_property_14,pl.i.user_defined_property_14 ,pl.v.user_defined_property_15,pl.i.user_defined_property_15 ,pl.v.user_defined_property_16,pl.i.user_defined_property_16 ,pl.v.user_defined_property_17,pl.i.user_defined_property_17 ,pl.v.user_defined_property_18,pl.i.user_defined_property_18 ,pl.v.user_defined_property_19,pl.i.user_defined_property_19 ); end if; -- 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; -- Set some complex default values if pl.i.date_out = false then pl.v.date_out := SYSDATE; pl.i.date_out := true; end if; if pl.i.developer = false then pl.v.developer := USER; pl.i.developer := true; end if; end if; END; --======================== PRE-PROCESS (DEL,SEL) ============================-- PROCEDURE pre_process(operation varchar2,id number) IS BEGIN -- Access rights for change history derive from the module -- Access rights checking performed by triggers in config 4.0.9 -- ciiacc.check_access_rights(id,sac_type,operation,'SAC'); -- if operation is 'DELETE', make sure no non-cascading references exist if operation = 'DEL' then check_delete(id); end if; END; --===================== POST-PROCESS (INS,UPD,SEL) ==========================-- PROCEDURE post_process(operation varchar2,id number, pl ciochange_history.data) IS BEGIN null; END; --========================= POST PROCESS (DEL) ==============================-- PROCEDURE post_process(operation varchar2,id number) IS BEGIN null; END; --============================= CHECK DELETE ================================-- PROCEDURE check_delete(id number) IS dummy number; error_count number := 0; BEGIN null; END; --============================= CHECK UNIQUE ================================-- -- return false if any other change histories have the same ref and mod_ref FUNCTION check_unique(id number,module_reference number, change_ref varchar2) RETURN boolean IS cnt number ; BEGIN select count(*) into cnt from ci_change_history where change_ref = check_unique.change_ref and module_reference = check_unique.module_reference and id != check_unique.id; if cnt = 0 then return(true); else return(false); end if; END; --============================= CHECK DATE ================================-- -- return false if any other change histories have a null date_transferred FUNCTION check_date(module_reference number) RETURN boolean IS cnt number ; BEGIN select count(*) into cnt from ci_change_history where module_reference = check_date.module_reference AND date_transferred is null; if cnt <= 1 then return(true); else return(false); end if; END; --================================== END ====================================-- -- -- Package instantiation block -- BEGIN is_installed := true; END; /