rem rem $Header: L:\\\\model\\repman40\\api\\RCS\\cioct.hpb 1.3 1998/10/09 12:23:31 jkchow Exp $ rem Rem Copyright (c) 1997 by Oracle Corporation Rem NAME Rem cioct.hpb - Rem DESCRIPTION Rem Rem RETURNS Rem Rem NOTES Rem Rem MODIFIED (MM/DD/YY) Rem stlyon 01/24/03 - B2670691, B1461754 Rem jkc 09/07/98 - B610833 Rem cvanes 06/17/98 - B684028 Rem cvanes 06/19/97 - Creation REM *************************************************************************** REM Hand-carved package body for ORACLE COLLECTION TYPE created on 19-MAY-97 REM *************************************************************************** CREATE OR REPLACE PACKAGE BODY cihoct IS -- Generic post-process routines PROCEDURE check_delete(id number); pac_type constant varchar2(6) := 'ORT'; --======================== PRE-PROCESS (INS,UPD) ============================-- PROCEDURE pre_process(operation varchar2,id number, pl in out NOCOPY ciooracle_collection_type.data) IS BEGIN -- Access control checks -- Access rights checking performed by triggers in config 4.0.9 -- ciiacc.check_access_rights(pl.v.id,pac_type,operation,'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 := pac_type; pl.i.element_type_name := true; pl.v.ort_type := 'OCT'; pl.i.ort_type := true; end if; /** b610833 jkc 07sep98 **/ /** altering to NESTED TABLE from VARRAY clears v_array_limit property **/ if (pl.v.collection_type = 'NESTED TABLE') and (operation = 'UPD') and (pl.i.collection_type = true) then pl.v.varray_limit := null; pl.i.varray_limit := true; end if; /** b646190 jkc 09sep98 **/ /** nullifying properties of other when changing collection of **/ if (operation = 'UPD') and (pl.i.collection_of = true) then if (pl.v.collection_of = 'OBJECT') then pl.v.scalar_maximum_length := null; pl.i.scalar_maximum_length := true; pl.v.scalar_decimal_places := null; pl.i.scalar_decimal_places := true; pl.v.scalar_datatype := null; pl.i.scalar_datatype := true; elsif (pl.v.collection_of = 'SCALAR') then pl.v.oracle_object_type_reference := null; pl.i.oracle_object_type_reference := true; end if; end if; if pl.v.scalar_datatype is not null then ciiutl.adjust_datatype_sizes(pl.v.id,'COL', pl.v.scalar_datatype,pl.v.scalar_maximum_length,pl.v.scalar_decimal_places, 'COLLECTION_SCALAR_DATATYPE', -- B2670691, B1461754 : 'DATA_TYPE'->'COLLECTION_SCALAR_DATATYPE' null); end if; END; --======================== PRE-PROCESS (DEL,SEL) ============================-- PROCEDURE pre_process(operation varchar2,id number) IS BEGIN -- Access control checks -- Access rights checking performed by triggers in config 4.0.9 -- ciiacc.check_access_rights(id,pac_type,operation,'SHR'); -- 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 ciooracle_collection_type.data) IS BEGIN if operation = 'INS' then ciiutl.create_appxxx(pac_type,pl.v.id,pl.v.name); end if; -- B684028 CvE 17Jun98 if operation = 'UPD' and pl.i.name then cioapp_con_interface.traverse('CIHAPPCONU1',id,'APPORT'); end if; -- This code can be deleted after the next configuration (after 2.0) -- as a constraint in octcons.sql will replace it if operation != 'SEL' then if not ((pl.v.collection_of = 'SCALAR' and pl.v.scalar_datatype is not null and pl.v.oracle_object_type_reference is null) or (pl.v.collection_of != 'SCALAR' and pl.v.scalar_datatype is null and pl.v.scalar_decimal_places is null and pl.v.scalar_maximum_length is null and pl.v.oracle_object_type_reference is not null)) then ciierr.fatal(1418, ciiutl.identify(id, 'OCT')); end if; end if; END; --========================= POST PROCESS (DEL) ==============================-- PROCEDURE post_process(operation varchar2,id number) IS BEGIN if operation = 'DEL' then -- Delete the oracle collection type and all it's related sub-bits ciiutl.delete_element(id,pac_type); end if; END; --============================= CHECK DELETE ================================-- PROCEDURE check_delete(id number) IS dummy number; error_count number := 0; BEGIN null; -- 4.0.12 Removed all simple delete checking -- Check if this oracle collection type is connected to other application systems -- Check if any columns are referenced or embedded in me END; --================================== END ====================================-- -- -- Package instantiation block -- BEGIN is_installed := true; END; /