REM This script flags objects to be reloaded for 4_3 (MR5) Upgrade 

DECLARE 

BEGIN 

-- UPDATES THE OBJECTS IN THE FOLLOWING STAGES

-- JRPACK   -- already done
-- CKPACCOM -- already done
-- CKPACK   -- already done
-- CKVIEW   -- NEW FOR MR4
-- JRVIEW   -- already done
-- CKTABS   -- already done
	
	-- UPDATE FOR PACKAGES
	UPDATE CK_INSTALLED_OBJECTS 		
	SET CI_CREATED = 'R'		
	WHERE  CI_TYPE = 'PACKAGE'		
	AND    CI_NAME IN ( 'JR_CONFIGURATION_DEF'
                    , 'JR_RULE_PROCS');

	-- UPDATE FOR PACKAGE BODIES
	UPDATE CK_INSTALLED_OBJECTS 		
	SET    CI_CREATED = 'R'		
	WHERE  CI_TYPE    = 'PACKAGE BODY'		
	AND    CI_NAME IN ( 'CIHMCN'	
                    , 'CIOMODULE_COMPONENT_INCLUSION'	 
                    , 'CIMAPPCON'
                    , 'JR_CONFIGURATION_DEF'
                    , 'RMMAN'
                    , 'JR_WORKAREA'	
                    , 'JR_DEPENDENCY'
                    , 'JR_RULE_PROCS'
					, 'CIOKEY_COMPONENT');  
                                     
	
  -- UPDATE for VIEWS
  --	UPDATE CK_INSTALLED_OBJECTS 		
  --	SET    CI_CREATED = 'R'		
  --	WHERE  CI_TYPE    = 'VIEW'		
  --	AND    CI_NAME IN ( 'CI_ROOT_CONTAINER_ELEMENTS' 
  --                , 'CI_ROOT_APPLICATION_SYSTEMS'
  --                , 'CI_CONTAINER_ELEMENTS' 
  --                , 'SDD_LOST_AND_FOUND' );  
                    
  -- UPDATE for TABLE
  --	UPDATE CK_INSTALLED_OBJECTS 		
  --	SET    CI_CREATED = 'R'		
  --	WHERE  CI_TYPE    = 'TABLE'		
  --	AND    CI_NAME IN ( 'CK_TEMP_IRIDS' );   
  --	
	-- Update for verify of stage
	UPDATE CK_INSTALLED_OBJECTS 
	SET    CI_CREATED = 'Y'
	WHERE  CI_STAGE   = 'CKUPD4_3';
	
	COMMIT;
	
EXCEPTION

  WHEN OTHERS THEN 

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

END;
/
