rem rem $Header: L:\\\\model\\repman40\\api\\RCS\\ciubi.mpb 1.3 1998/12/14 17:25:26 cvanes Exp $ rem Rem Copyright (c) 1995 by Oracle Corporation Rem NAME Rem ciubi.mpb - Rem DESCRIPTION Rem Rem RETURNS Rem Rem NOTES Rem Rem MODIFIED (MM/DD/YY) Rem cvanes 11/06/96 - Creation CREATE OR REPLACE PACKAGE BODY cimubi IS PROCEDURE check_cihubiu1(conid number) IS -- Returns all ITEs with same name in the same 'PARENT' (via parent_ivid) -- For RMCs this is all we need, but for SMCs, their parent_ivid refrs to the -- owning module, but the ITEs need only be unique withing their MCO. -- CvE 26Sep2000 Added parent_ivid clause below for performance cursor get_dup_sac(constraint_id number, cdapi_activity number) is select sac1.irid sac1_ref /* CIMUBI.get_dup_sac */ ,sac1.types sac1_types ,sac1.item_for sac1_item_for ,sac1.module_unit_ref sac1_mun_ref ,sac1.sql_query_set_ref sac1_sqs_ref ,sac2.irid sac2_ref ,sac2.types sac2_types ,sac2.item_for sac2_item_for ,sac2.module_unit_ref sac2_mun_ref ,sac2.sql_query_set_ref sac2_sqs_ref from sdd_ite sac1 ,sdd_ite sac2 ,rm_deferred_checks dc where dc.element = sac1.irid and dc.assertion = constraint_id and dc.activity = cdapi_activity and sac1.parent_ivid = sac2.parent_ivid and sac1.name = sac2.name and sac1.irid != sac2.irid; -- Given a reference to a Module Unit (MUN) this returns -- the IDs of all Module Components and their Subcomponents -- whether the MUN reference passed in is the ID of an MCO or a SUB -- PL/SQL is painful, but get_sub_components2 and get_sub_components are identical, -- but as they are called from inside each other, ther must be two cursors -- and therefore two cursor definitions. Both these queries should be identical cursor get_sub_components(mun_ref number) is select sub.id, 'SUB' subtype /* CIMUBI.get_sub_components */ from ci_subcomponents sub where sub.module_component_reference = mun_ref union select mco.id, 'MCO' subtype from ci_module_components mco where mco.id = mun_ref union select sub.id, 'SUB' subtype from ci_subcomponents sub where sub.id = mun_ref union select sub.module_component_reference id, 'MCO' subtype from ci_subcomponents sub where sub.id = mun_ref; -- PL/SQL is painful, but get_sub_components2 and get_sub_components are identical, -- but as they are called from inside each other, ther must be two cursors -- and therefore two cursor definitions. Both these queries should be identical cursor get_sub_components2(mun_ref number) is select sub.id, 'SUB' subtype /* CIMUBI.get_sub_components */ from ci_subcomponents sub where sub.module_component_reference = mun_ref union select mco.id, 'MCO' subtype from ci_module_components mco where mco.id = mun_ref union select sub.id, 'SUB' subtype from ci_subcomponents sub where sub.id = mun_ref union select sub.module_component_reference id, 'MCO' subtype from ci_subcomponents sub where sub.id = mun_ref; begin rmman.record_check(conid,null,null,null,true); for el in get_dup_sac(conid, cdapi.activity) loop -- We have a candidate clash -- NAME is same, but are they in the same Module Component/Subcomponent ? if el.sac1_item_for = 'SQS' then if el.sac1_sqs_ref = el.sac2_sqs_ref then -- We now have a UID clash rmman.record_check(conid,el.sac1_ref,null,cdapi.activity,false,'Y', ciiutl.identify(el.sac1_ref, el.sac1_types), ciiutl.identify(el.sac2_ref, el.sac2_types)); end if; else for sac1_list in get_sub_components(el.sac1_mun_ref) loop for sac2_list in get_sub_components2(el.sac2_mun_ref) loop if sac1_list.id = sac2_list.id then -- We now have a UID clash rmman.record_check(conid,el.sac1_ref,null,cdapi.activity,false,'Y', ciiutl.identify(el.sac1_ref, el.sac1_types), ciiutl.identify(el.sac2_ref, el.sac2_types)); end if; end loop; end loop; end if; end loop; END check_cihubiu1; END; /