rem rem $Header: L:\\\\model\\repman40\\api\\RCS\\cifun.mpb 1.1 1998/05/28 16:20:01 mfrobins Exp $ rem Rem Copyright (c) 1994 by Oracle Corporation Rem NAME Rem cifun.mpb - Rem DESCRIPTION Rem Rem RETURNS Rem Rem NOTES Rem Rem MODIFIED (MM/DD/YY) Rem cvanes 08/01/96 - Creation Rem aheath 03/14/95 - Rewrite got all the code working Rem jwetherb 01/16/94 - Add CIHFUNE_MASTER_COPY and CIHFUNE_PARENT_COPY Rem aheath 07/11/94 - Creation CREATE OR REPLACE PACKAGE BODY cimfun IS cursor elms(conid rm.reference) is (select element,parent_reference,common_function_reference from rm_deferred_checks d,ci_functions f where d.assertion = conid and f.id = element); --============================ CIHFUNE_MAST_ANC =============================-- -- Function %0!s: Master function %1!s cannot be an ancester of this function -- NOT called from ANYWHERE PROCEDURE check_cihfune_mast_anc(conid rm.reference) IS cnt number; BEGIN for fun in elms(conid) loop if fun.parent_reference is not null and fun.common_function_reference is not null then begin select count(*) into cnt from i$sdd_fun where jr_vn.context(ivid) > 0 and irid = fun.common_function_reference connect by prior parent_ref = irid start with irid = fun.parent_reference; if cnt = 0 then rmman.record_check(conid,fun.element,null,null,true); else rmman.record_check(conid,fun.element,null,null,false,'Y', ciiutl.identify(fun.element, 'FUN'), ciiutl.identify(fun.common_function_reference, 'FUN')); end if; exception when others then if sqlcode = -1436 then -- this should get caught in CIHFUNE_PARENT_DESCENDENT null; else raise; end if; end; else rmman.record_check(conid,fun.element,null,null,true); end if; end loop; END; --========================= CIHFUNE_PARENT_DESCENDENT =======================-- -- Function %0!s: Parent function %0!s is a descendent of this function PROCEDURE check_cihfune_par_desc(conid rm.reference) IS cnt number; BEGIN for fun in elms(conid) loop if fun.parent_reference is not null then begin select count(*) into cnt from i$sdd_fun where jr_vn.context(ivid) > 0 and irid = fun.element connect by prior parent_ref = irid start with irid = fun.parent_reference; rmman.record_check(conid,fun.element,null,null,true); exception when others then if sqlcode = -1436 then rmman.record_check(conid,fun.element,null,null,false,'Y', ciiutl.identify(fun.element, 'FUN'), ciiutl.identify(fun.parent_reference, 'FUN')); else raise; end if; end; else rmman.record_check(conid,fun.element,null,null,true); end if; end loop; END; --============================ CIHFUNE_PARENT_COPY ==========================-- -- %0!s: Cannot be both a Parent function and a Copy function procedure check_cihfune_parent_copy(conid rm.reference) is dummy varchar2(1); begin for fun in elms(conid) loop if fun.common_function_reference is not null then select count(*) into dummy from ci_functions where parent_reference = fun.element; if dummy > 0 then rmman.record_check(conid,fun.element,null,null,false,'Y', ciiutl.identify(fun.element, 'FUN')); else rmman.record_check(conid,fun.element,null,null,true); end if; else rmman.record_check(conid,fun.element,null,null,true); end if; end loop; end; --============================ CIHFUNE_MASTER_COPY ==========================-- -- %0!s: Cannot be both a Master function and a Copy function procedure check_cihfune_master_copy(conid rm.reference) is cnt number; begin for fun in elms(conid) loop if fun.common_function_reference is not null then select count(*) into cnt from ci_functions where common_function_reference = fun.element; if cnt > 0 then rmman.record_check(conid,fun.element,null,null,false,'Y', ciiutl.identify(fun.element, 'FUN')); else rmman.record_check(conid,fun.element,null,null,true); end if; else rmman.record_check(conid,fun.element,null,null,true); end if; end loop; end; END; /