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

DECLARE

BEGIN



-- UPDATES THE OBJECTS IN THE FOLLOWING STAGES
-- CKPACCOM -- already done
-- JRPACK   -- already done



  -- UPDATE FOR PACKAGE SPECS
  -- JR_ACC_RIGHTS M90.002
  -- JR_UES_CHK M90.004
  UPDATE CK_INSTALLED_OBJECTS
  SET    CI_CREATED = 'R'
  WHERE  CI_TYPE    = 'PACKAGE'
  AND    CI_NAME IN ( 'JR_ACC_RIGHTS'
                    , 'JR_UES_CHK' );



  -- UPDATE FOR PACKAGE BODIES
  -- CKUXX M90.007
  -- JR_ACC_RIGHTS M90.002
  -- JR_FOLDER M90.003
  -- JR_NAME M90.001
  -- JR_UES_CHK M90.004
  -- JR_WASTEBASKET M90.005
  -- CIORELATION_INDEX M90.009
  -- JR_VERSION M90.010
  -- RMMAN M90.011
  UPDATE CK_INSTALLED_OBJECTS
  SET    CI_CREATED = 'R'
  WHERE  CI_TYPE    = 'PACKAGE BODY'
  AND    CI_NAME IN ( 'CKUXX'
                    , 'JR_ACC_RIGHTS'
                    , 'JR_FOLDER'
                    , 'JR_NAME'
                    , 'JR_UES_CHK'
                    , 'JR_WASTEBASKET'
                    , 'CIORELATION_INDEX'
                    , 'JR_VERSION'
                    , 'RMMAN');



  -- UPDATE FOR PACKAGE SPECS
  -- M90.004
  UPDATE CK_INSTALLED_OBJECTS
  SET    CI_CREATED = 'R'
  WHERE  CI_TYPE    = 'TRIGGER'
  AND    CI_NAME IN ( 'SDD_ATT_d'
                    , 'SDD_BUN_d'
                    , 'SDD_COL_d'
                    , 'SDD_COM_d'
                    , 'SDD_DAT_d'
                    , 'SDD_DBU_d'
                    , 'SDD_DFI_d'
                    , 'SDD_DOC_d'
                    , 'SDD_DOM_d'
                    , 'SDD_DST_d'
                    , 'SDD_E1_d'
                    , 'SDD_E2_d'
                    , 'SDD_E20_d'
                    , 'SDD_E3_d'
                    , 'SDD_E4_d'
                    , 'SDD_E5_d'
                    , 'SDD_E6_d'
                    , 'SDD_ENT_d'
                    , 'SDD_EXT_d'
                    , 'SDD_FIL_d'
                    , 'SDD_FILES_d'
                    , 'SDD_FUN_d'
                    , 'SDD_GRP_d'
                    , 'SDD_LAN_d'
                    , 'SDD_MOD_d'
                    , 'SDD_MUN_d'
                    , 'SDD_OCL_d'
                    , 'SDD_ODB_d'
                    , 'SDD_ORS_d'
                    , 'SDD_ORT_d'
                    , 'SDD_OSP_d'
                    , 'SDD_OSQ_d'
                    , 'SDD_OTB_d'
                    , 'SDD_PRS_d'
                    , 'SDD_QTD_d'
                    , 'SDD_QUE_d'
                    , 'SDD_SYN_d'
                    , 'SDD_TAB_d'
                    , 'SDD_UEE_d' );



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



  COMMIT;



EXCEPTION

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

END;
/
