rem rem $Header: L:\\\\model\\repman40\\api\\RCS\\ciarg.hpb 1.4 1998/12/14 17:04:06 cvanes Exp $ rem rem Copyright (c) 1994 by Oracle Corporation rem NAME rem ciarg.hpb - rem DESCRIPTION rem rem RETURNS rem rem NOTES rem rem MODIFIED (MM/DD/YY) rem stlyon 22/01/03 - B2670691 : rem aheath 07/08/94 - Creation rem *************************************************************************** rem Hand-carved package body for MODULE ARGUMENT created on 21-OCT-94 rem *************************************************************************** CREATE OR REPLACE PACKAGE BODY ciharg IS -- Generic post-process routines PROCEDURE check_delete(id number); sac_type constant varchar2(6) := 'ARG'; pac_type constant varchar2(6) := 'MOD'; --======================== PRE-PROCESS (INS,UPD) ============================-- PROCEDURE pre_process(operation varchar2,id number, pl in out NOCOPY ciomodule_argument.data) IS pac_reference number; -- B2670691 : Define a REF_VALUES.REF_DOMAIN for non PLSQL module arguments. -- It used to be DATATYPE, but the CDAPI documentation says it should be DATATYPE_LARGE for GEM modules -- and DATATYPE_LARGE_PLSQL for PL/SQL modules. Initialise as GEM. ref_domain REF_VALUES.REF_DOMAIN%type := 'DATATYPE_LARGE'; BEGIN -- pac_reference := nvl(pl.v.general_module_reference, pl.v.plsql_module_reference); -- Access rights for module argument derive from the module -- Access rights checking performed by triggers in config 4.0.9 -- ciiacc.check_access_rights(pac_reference,pac_type, -- 'UPD','SHR'); -- 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; if pl.v.general_module_reference is not null then pl.v.module_type_for := 'GEM'; else pl.v.module_type_for := 'PLM'; end if; pl.i.module_type_for := true; end if; --#BEGIN -- 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; if operation = 'INS' then if pl.v.datastructure_reference is not null then pl.v.module_argument_for := 'DAT'; elsif pl.v.domain_reference is not null then pl.v.module_argument_for := 'DOM'; elsif pl.v.oracle_type_reference is not null then pl.v.module_argument_for := 'ORT'; elsif pl.v.table_definition_reference is not null then pl.v.module_argument_for := 'TBL'; elsif pl.v.column_reference is not null then pl.v.module_argument_for := 'COL'; else pl.v.module_argument_for := 'DATATYPE'; end if; if pl.i.prompt = false then --Bug #601510 pl.v.prompt := initcap(translate(pl.v.name, '_',' ')); pl.i.prompt := true; end if; else -- operation = 'UPD' --============================================================================== --The following section has been modified as a result of bug #725849. The code --ensures that only the item that has intentionally been updated in pl will have --a none null value. if not pl.i.datastructure_reference and not pl.i.domain_reference and not pl.i.table_definition_reference and not pl.i.column_reference and not pl.i.oracle_type_reference and not pl.i.datatype then null; elsif pl.i.datastructure_reference and pl.v.datastructure_reference is not null then pl.v.module_argument_for := 'DAT'; pl.v.domain_reference := null; pl.v.oracle_type_reference := null; pl.v.table_definition_reference := null; pl.v.column_reference := null; pl.v.datatype := null; elsif pl.i.datatype and pl.v.datatype is not null then pl.v.module_argument_for := 'DATATYPE'; pl.v.domain_reference := null; pl.v.oracle_type_reference := null; pl.v.column_reference := null; pl.v.datastructure_reference := null; pl.v.table_definition_reference := null; elsif pl.i.domain_reference and pl.v.domain_reference is not null then pl.v.module_argument_for := 'DOM'; pl.v.oracle_type_reference := null; pl.v.datastructure_reference := null; pl.v.table_definition_reference := null; pl.v.column_reference := null; pl.v.datatype := null; elsif pl.i.oracle_type_reference and pl.v.oracle_type_reference is not null then pl.v.module_argument_for := 'ORT'; pl.v.datastructure_reference := null; pl.v.table_definition_reference := null; pl.v.column_reference := null; pl.v.datatype := null; pl.v.domain_reference := null; elsif pl.i.table_definition_reference and pl.v.table_definition_reference is not null then pl.v.module_argument_for := 'TBL'; pl.v.domain_reference := null; pl.v.oracle_type_reference := null; pl.v.column_reference := null; pl.v.datatype := null; pl.v.datastructure_reference := null; elsif pl.i.column_reference and pl.v.column_reference is not null then pl.v.module_argument_for := 'COL'; pl.v.domain_reference := null; pl.v.oracle_type_reference := null; pl.v.datastructure_reference := null; pl.v.table_definition_reference := null; pl.v.datatype := null; end if; --end of section modified as a result of bug #725849 --============================================================================== end if; if operation='INS' or (operation='UPD' and pl.i.name) then pl.v.name := nls_upper(pl.v.name); -- B746524 cihtbl.remove_spaces(pl.v.name); -- B631806 end if; if pl.i.datatype or pl.i.length or pl.i.scale then if ( nls_upper(pl.v.module_type_for) = 'PLM' and pl.v.plsql_module_reference is not null ) -- B2670691 : if a PL/SQL module then ref_domain := 'DATATYPE_LARGE_PLSQL'; -- Domain defining precision and scale rules for PLSQL module arguments end if; ciiutl.adjust_datatype_sizes( pl.v.id, 'ARG', pl.v.datatype ,pl.v.length, pl.v.scale, ref_domain ); end if; --#END END; --======================== PRE-PROCESS (DEL,SEL) ============================-- PROCEDURE pre_process(operation varchar2,id number) IS BEGIN -- Access rights for module argument 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 ciomodule_argument.data) IS BEGIN null; END; --========================= POST PROCESS (DEL) ==============================-- PROCEDURE post_process(operation varchar2,id number) IS BEGIN if operation = 'DEL' then -- Delete this 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 -- 4.0.12 Removed all simple delete checking -- Check if any Module_Detail_Column_Usages are connected to me null; END; --================================== END ====================================-- -- -- Package instantiation block -- BEGIN is_installed := true; END; /