rem rem $Header: L:\\\\model\\repman40\\api\\RCS\\cilip.hpb 1.1 1998/05/28 16:27:29 mfrobins Exp $ rem Rem Copyright (c) 1996 by Oracle Corporation Rem NAME Rem cilip.hpb - Rem DESCRIPTION Rem Rem RETURNS Rem Rem NOTES Rem Rem MODIFIED (MM/DD/YY) Rem spatanka 08/06/96 - Creation REM *************************************************************************** REM Hand-carved package body for LOCAL INDEX PARTITION created on 05-AUG-96 REM *************************************************************************** CREATE OR REPLACE PACKAGE BODY cihlip IS -- Generic post-process routines PROCEDURE check_delete(id number); occur_type CONSTANT varchar2(6) := 'LIP'; sac_type CONSTANT varchar2(6) := 'INP'; pac_type CONSTANT varchar2(6) := 'INS'; --======================== PRE-PROCESS (INS,UPD) ============================-- PROCEDURE pre_process(operation varchar2,id number, pl IN OUT NOCOPY ciolocal_index_partition.data) IS BEGIN -- Access rights for local index partition derive from the local index storage -- Access rights checking performed by triggers in config 4.0.9 -- ciiacc.check_access_rights(pl.v.index_storage_reference,pac_type, -- 'UPD','SAC'); -- 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_partition_type := occur_type; pl.i.index_partition_type := TRUE; IF pl.v.name is null THEN SELECT 'PARTITION_' || (COUNT(*) +1) INTO pl.v.name FROM ci_local_index_partitions lip WHERE lip.index_storage_reference = pl.v.index_storage_reference; pl.i.name := TRUE; END IF; END IF; END; --======================== PRE-PROCESS (DEL,SEL) ============================-- PROCEDURE pre_process(operation varchar2,id number) IS BEGIN -- Access rights for local index partition derive from the local index storage -- 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 ciolocal_index_partition.data) IS ins_ok boolean:=FALSE; tbp_id number; ins_id number; tbp_types number; ins_types number; BEGIN --B940324 Do not allow index partition to be created against a table --partition which is on a different table to the index storage. IF operation IN ('INS','UPD') AND pl.i.table_partition_reference THEN BEGIN SELECT tbp.id,tbp.types,ins.id,ins.types INTO tbp_id,tbp_types,ins_id,ins_types FROM ci_table_partitions tbp ,ci_index_storages ins WHERE ins.id=pl.v.index_storage_reference AND tbp.id=pl.v.table_partition_reference AND tbp.table_implementation_reference!=ins.table_implementation_reference; EXCEPTION WHEN NO_DATA_FOUND THEN ins_ok:=TRUE; END; IF NOT ins_ok THEN --Specified Table Partition %0!s is on different table to Index Storage %1!s ciierr.fatal(1046,jr_name.get_path(tbp_id,tbp_types,'NAME') ,jr_name.get_path(ins_id,ins_types,'NAME')); END IF; END IF; END; --========================= POST PROCESS (DEL) ==============================-- PROCEDURE post_process(operation varchar2,id number) IS BEGIN IF operation = 'DEL' THEN -- Delete the local index partition 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; --================================== END ====================================-- -- -- Package instantiation block -- BEGIN is_installed := TRUE; END; /