REM This script flags objects to be reloaded for 4_4 Upgrade

DECLARE

BEGIN

-- UPDATES THE OBJECTS IN THE FOLLOWING STAGES

-- CKINDX -- already done
-- CKPACCOM -- already done
-- CKTABS -- alredy done
-- JRPACK   -- already done



  -- UPDATE FOR PACKAGE BODIES
  -- CIUE_UTIL - M89.001
  -- JR_SYS_PRIVS - M89.001
  -- RMMAC - M89.001
  -- JR_COPY - M89.003, M89.005
  -- JR_CHECK_REFS - M89.004, M89.006
  UPDATE CK_INSTALLED_OBJECTS
  SET    CI_CREATED = 'R'
  WHERE  CI_TYPE    = 'PACKAGE BODY'
  AND    CI_NAME IN ( 'CIUE_UTIL'
                    , 'JR_SYS_PRIVS'
                    , 'RMMAC'
                    , 'JR_COPY'
                    , 'JR_CHECK_REFS' );



  -- UPDATE FOR TABLES
  -- M89.001
  UPDATE CK_INSTALLED_OBJECTS
  SET    CI_CREATED = 'R'
  WHERE  CI_TYPE    = 'TABLE'
  AND    CI_NAME IN ( 'RM$ACTIVITIES'
                    , 'RM$DEFERRED_CHECKS'
                    , 'RM$DEFERRED_QUERIES'
                    , 'RM$VIOLATIONS' );



  -- UPDATE FOR INDEXES
  -- M89.001
  UPDATE CK_INSTALLED_OBJECTS
  SET    CI_CREATED = 'R'
  WHERE  CI_TYPE    = 'INDEX'
  AND    CI_NAME IN ( 'RM$VIOLATIONS_ACTIVITY'
                    , 'RM$VIOLATIONS_ASSERTION'
                    , 'RM$VIOLATIONS_ELEMENT'
                    , 'RM$VIOLATIONS_PROPERTY'
                    , 'RM$DEFERRED_QUERIES_1'
                    , 'RM$DEFERRED_QUERIES_ELEMENT'
                    , 'RM$ACTIVITIES_PARENT'
                    , 'RM$ACTIVITIES_CHILDREN'
                    , 'RM$ACTIVITIES_OPEN_CHILD'
                    , 'RM$ACTIVITIES_OPEN_PARENT'
                    , 'RM$DEFERRED_CHECKS_ASSERTION'
                    , 'RM$DEFERRED_CHECKS_ELEMENT'
                    , 'RM$DEFERRED_CHECKS_ID'
                    , 'RM$DEFERRED_CHECKS_ACTIVITY' );



  -- Update for verify of stage
  UPDATE CK_INSTALLED_OBJECTS
  SET    CI_CREATED = 'Y'
  WHERE  CI_STAGE   = 'CKUPD4_4';



  COMMIT;



EXCEPTION

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

END;
/
