Rem Copyright (c) 1994 by Oracle Corporation Rem NAME Rem civoa.mpb - Rem DESCRIPTION Rem Rem RETURNS Rem Rem NOTES Rem Rem MODIFIED (MM/DD/YY) Rem cvanes 11/15/99 - Creation CREATE OR REPLACE PACKAGE BODY cimamcamc IS cursor amcamc_c(conid rm.reference) is select d.element from rm_deferred_checks d where d.assertion = conid; --============================ CIHAMCAMCE_UNIQUE_NAME =============================-- --%0!s: The Name must be unique in the owning object PROCEDURE check_cihamcamce_unique_name(conid rm.reference) IS my_name ci_view_object_attributes.name%type; my_amc_ref number; my_type varchar2(6); other_id number; other_type varchar2(6); BEGIN FOR amcamc_rec in amcamc_c(conid) LOOP select amcamc.role_name name, amcamc.parent_app_module_reference amc_ref, 'AMCAMC' my_type into my_name, my_amc_ref, my_type from ci_application_module_usages amcamc where amcamc.id = amcamc_rec.element union select vou.name name, vou.application_module_reference amc_ref, 'VOU' my_type from ci_view_usages vou where vou.id = amcamc_rec.element union select vlu.name name, vlu.application_module_reference amc_ref, 'VLU' my_type from ci_view_link_usages vlu where vlu.id = amcamc_rec.element; -- In addition to the UID in the model if my_type in ('AMCAMC','VOU') then select max(other_vlu.id), 'VLU' into other_id, other_type from ci_view_link_usages other_vlu where other_vlu.name = my_name and other_vlu.application_module_reference = my_amc_ref; end if; if other_id is null and my_type in ('AMCAMC','VLU') then select max(other_vou.id), 'VOU' into other_id, other_type from ci_view_usages other_vou where other_vou.name = my_name and other_vou.application_module_reference = my_amc_ref; end if; if other_id is null and my_type in ('VOU','VLU') then select max(other_amcamc.id), 'AMCAMC' into other_id, other_type from ci_application_module_usages other_amcamc where other_amcamc.role_name = my_name and other_amcamc.parent_app_module_reference = my_amc_ref; end if; if other_id is not null then rmman.record_check(conid,amcamc_rec.element,null,null,false,'Y' ,ciiutl.identify(amcamc_rec.element, my_type), ciiutl.identify(other_id, other_type)); else rmman.record_check(conid,amcamc_rec.element,null,null,true); end if; END LOOP; END; --============================ CIHAMCAMCE_LOOP_CHECK =============================-- --%0!s: The Name must be unique in the owning object PROCEDURE check_cihamcamce_loop_check(conid rm.reference) IS dummy number; BEGIN FOR amcamc_rec in amcamc_c(conid) LOOP begin select count(*) into dummy from i$sdd_amcamc amcamc connect by amcamc.parent_app_module_ref = prior amcamc.child_app_module_ref and jr_vn.context(amcamc.parent_ivid) > 0 start with amcamc.irid = amcamc_rec.element; rmman.record_check(conid,amcamc_rec.element,null,null,true); exception when others then if sqlcode = -1436 then rmman.record_check(conid,amcamc_rec.element,null,null,false,'Y' ,ciiutl.identify(amcamc_rec.element, 'AMCAMC')); else raise; end if; end; end loop; END; END; /