REM This script flags objects to be reloaded for MR4(9i) Upgrade 

DECLARE 

BEGIN 

-- UPDATES THE OBJECTS IN THE FOLLOWING STAGES
-- CKPACK   -- already done
-- CKPACCOM -- already done
-- JROPACK  -- New for M49
-- JRPACK	  -- already done
-- JRTRIG   -- already done
 
 -- UPDATE for PACKAGE SPECS
  UPDATE CK_INSTALLED_OBJECTS 		
	SET    CI_CREATED = 'R'		
	WHERE  CI_TYPE    = 'PACKAGE'		
	AND    CI_NAME    = 'RMPATCH'; --2160794  

 -- UPDATE for PACKAGE BODIES
	UPDATE CK_INSTALLED_OBJECTS 		
	SET    CI_CREATED = 'R'		
	WHERE  CI_TYPE    = 'PACKAGE BODY'		
	AND    CI_NAME IN ( 'CIMMUN'         
						        , 'JR_CHECK_REFS'
					   	      , 'JR_DEPENDENCY'
						        , 'JR_WASTEBASKET'
						        , 'JR_COPY'
                    , 'SDDODPND_PURGING_BR_POLICY' 
                    , 'JR_SYS_PRIVS'
                    , 'JR_WORKAREA' 
                    , 'JR_REG_VER'
                    , 'JR_RULE_PROCS'
                    , 'RMPATCH' );  
                                     
  -- UPDATE for TRIGGERS
   UPDATE CK_INSTALLED_OBJECTS 		
	 SET    CI_CREATED = 'R'		
	 WHERE  CI_TYPE    = 'TRIGGER'		
	 AND    CI_NAME IN ( 'SDD_MTI_D'
                     , 'SDD_ENT_D' 
                     , 'SDD_RELEND_BR'); 
	
  -- UPDATE for VIEWS
	
  -- UPDATE for TABLE
	
  -- Update for verify of stage
  UPDATE CK_INSTALLED_OBJECTS 
  SET    CI_CREATED = 'Y'
  WHERE  CI_STAGE   = 'CKUPDM49';

  COMMIT;
	
EXCEPTION

  WHEN OTHERS THEN 

     dbms_output.put_line('* Exception Raised  ');
     dbms_output.put_line('...ERROR: '||substrb(sqlerrm,1,240));
     rollback work;
     RAISE;

END;
/
