rem rem $Header: L:\\\\model\\repman40\\api\\RCS\\ciuis.hpb 1.1 1998/05/28 16:58:36 mfrobins Exp $ rem Rem Copyright (c) 1997 by Oracle Corporation Rem NAME Rem ciuis.hpb - Rem DESCRIPTION Rem Rem RETURNS Rem Rem NOTES Rem Rem MODIFIED (MM/DD/YY) Rem cvanes 06/19/97 - Creation REM *************************************************************************** REM Hand-carved package body for USER OBJECT INDEX STORAGE created on 19-MAY-97 REM *************************************************************************** CREATE OR REPLACE PACKAGE BODY cihuis IS -- Generic post-process routines PROCEDURE check_delete(id number); sac_type constant varchar2(6) := 'INS'; pac_type varchar2(6); pac_reference number; --======================== PRE-PROCESS (INS,UPD) ============================-- PROCEDURE pre_process(operation varchar2,id number, pl in out NOCOPY ciouser_object_index_storage.data) IS tab_ref varchar2(38); BEGIN -- Calculate the PAC reference which determines access control rights -- pac_reference := nvl(nvl(pl.v.cluster_reference, pl.v.snapshot_reference), -- pl.v.table_implementation_reference); -- pac_type := ciiutl.short_type(pac_reference); -- Access rights for user object index storage derive from the reference -- Access rights checking performed by triggers in config 4.0.9 -- ciiacc.check_access_rights(pac_reference,pac_type,'UPD'); -- 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; pl.v.index_storage_subtype := 'UIS'; pl.i.index_storage_subtype := true; if pl.v.index_reference is not null then pl.v.index_storage_implementing := 'IND'; elsif pl.v.primary_key_reference is not null then pl.v.index_storage_implementing := 'PCO'; else pl.v.index_storage_implementing := 'UCO'; end if; pl.i.index_storage_implementing := true; if pl.v.cluster_reference is not null then pl.v.index_storage_on := 'CLI'; elsif pl.v.snapshot_reference is not null then pl.v.index_storage_on := 'SNI'; else pl.v.index_storage_on := 'TBI'; end if; pl.i.index_storage_on := true; end if; END; --======================== PRE-PROCESS (DEL,SEL) ============================-- PROCEDURE pre_process(operation varchar2,id number) IS BEGIN -- Access rights for user object index storage derive from the reference -- 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 ciouser_object_index_storage.data) IS BEGIN null; END; --========================= POST PROCESS (DEL) ==============================-- PROCEDURE post_process(operation varchar2,id number) IS BEGIN if operation = 'DEL' then -- Delete the user object index storage and all it's related sub-bits ciiutl.delete_element(id,sac_type); end if; END; --============================= CHECK DELETE ================================-- PROCEDURE check_delete(id number) IS dummy number; error_count number := 0; BEGIN null; END; --============================= CHECK TABLES MATCH ================================-- -- return false if TABLE referenced by the index is different to that of the -- table that the user index storage references B1271503 FUNCTION check_tables_match(index_ref number, tab_id number) RETURN boolean IS index_table_ref number(38); BEGIN SELECT max(IND.TABLE_DEFINITION_REFERENCE) INTO index_table_ref FROM CI_RELATION_INDEXES IND WHERE index_ref = IND.ID; if index_table_ref = tab_id then return(true); else return(false); end if; END; --================================== END ====================================-- -- -- Package instantiation block -- BEGIN is_installed := true; END; /