rem rem $Header: L:\\\\model\\repman40\\api\\RCS\\cifil.mpb 1.3 1998/12/31 18:03:15 cvanes Exp $ rem Rem Copyright (c) 1995 by Oracle Corporation Rem NAME Rem cifil.mpb - Rem DESCRIPTION Rem Rem RETURNS Rem Rem NOTES Rem Rem MODIFIED (MM/DD/YY) Rem cvanes 10/24/96 - Creation Rem cvanes 10/23/96 - Creation CREATE OR REPLACE PACKAGE BODY cimfil IS cdapi_activity number; FUNCTION is_fil_name_unique(app_id number, fil_id number, fil_pathname varchar2, sac_type varchar2, clash_id out number, clash_types out number) return boolean is cursor clashes(fil_id number, fil_pathname varchar2, sac_type varchar2) is select fil.id id , fil.types types from sdd_folder_members appxxx ,ci_os_files fil where fil.id = appxxx.member_object and app_id = appxxx.folder_reference and fil.full_pathname = fil_pathname and fil.id != fil_id UNION ALL select dfi.irid id , dfi.types types from sdd_folder_members appxxx ,ci_databases pac ,ci_database_files dfi where pac.ivid = dfi.parent_ivid and pac.irid = appxxx.member_object and app_id = appxxx.folder_reference and dfi.full_pathname = fil_pathname and dfi.irid != fil_id and dfi.element_type_name = sac_type; BEGIN for clash in clashes(fil_id, fil_pathname, sac_type) loop -- Any match means a fail. Just report first one clash_id := clash.id; clash_types := clash.types; return false; end loop; clash_id := null; clash_types := null; return true; END is_fil_name_unique; FUNCTION is_fil_name_unique(app_id number, fil_id number, clash_id out number, clash_types out number) return boolean is fil_pathname varchar2(240); sac_type varchar2(10); begin select max(fil.full_pathname) fil_pathname ,null sac_type into fil_pathname ,sac_type from ci_os_files fil where fil_id = fil.irid; if fil_pathname is null then select max(dfi.full_pathname) fil_pathname ,'DFI' sac_type into fil_pathname ,sac_type from ci_database_files dfi where fil_id = dfi.irid; end if; return is_fil_name_unique(app_id, fil_id, fil_pathname, sac_type, clash_id, clash_types); end; --========================================================================== PROCEDURE check_cihfilu1(conid number) IS clash_id number; clash_types number; cursor appfil_share(constraint_id number) is select appxxx.folder_reference app_id ,fil.full_pathname fil_pathname ,fil.id fil_id ,null sac_type ,fil.types fil_types from sdd_folder_members appxxx ,ci_os_files fil ,rm_deferred_checks dc where dc.assertion = constraint_id and dc.activity = cdapi_activity and dc.element = fil.id and fil.id = appxxx.member_object UNION ALL select appxxx.folder_reference app_id ,dfi.full_pathname fil_pathname ,dfi.irid fil_id ,'DFI' sac_type ,dfi.types fil_types from sdd_folder_members appxxx ,ci_databases pac ,ci_database_files dfi ,rm_deferred_checks dc where dc.assertion = constraint_id and dc.activity = cdapi_activity and dc.element = dfi.irid and pac.ivid = dfi.parent_ivid and pac.irid = appxxx.member_object; BEGIN rmman.record_check(conid,null,null,null,true); -- For each application system and fil element pair cdapi_activity := cdapi.activity; for appfil in appfil_share(conid) loop if not is_fil_name_unique(appfil.app_id, appfil.fil_id, appfil.fil_pathname ,appfil.sac_type, clash_id, clash_types) then rmman.record_check(conid,clash_id,null,cdapi.activity,false,'Y', ciiutl.identify(appfil.fil_id, appfil.fil_types), appfil.fil_pathname, ciiutl.identify(clash_id, clash_types), ciiutl.identify(appfil.app_id, appfil.fil_types)); end if; end loop; END; END; /