__IF_EXISTS__
SELECT 1
  FROM CI_UT_INSTL_DTL
WHERE SCRIPT_FILE_NAME = 'FW43010_POSTDATA1.SQL'
   AND END_DTTM IS NOT NULL
/
__THEN__
 
__EXIT__
 
__ENDIF__
 
__IF_EXISTS__
SELECT 1
  FROM CI_INSTALL_PROD
WHERE INSTALL_OPT_ID = '11111'
   AND OWNER_FLG = 'F1'
/
__ELSE__
 
__EXIT__
 
__ENDIF__

UPDATE F1_MIGR_DATA_ST SET BO_STATUS_CD = 'APPLYING' WHERE BO_STATUS_CD = 'APPLIEDERROR' AND BUS_OBJ_CD = 'F1-MigrDataSetImport'
/

UPDATE F1_MIGR_DATA_ST SET BO_STATUS_CD = 'CANCEL' WHERE BO_STATUS_CD = 'CANCELAPPLY' AND BUS_OBJ_CD = 'F1-MigrDataSetImport'
/

UPDATE F1_MIGR_TRANS SET BO_STATUS_CD = 'CANCEL' WHERE EXISTS(SELECT 'x' FROM F1_MIGR_DATA_ST DS WHERE DS.BO_STATUS_CD = 'CANCEL' AND DS.MIGR_DATA_SET_ID = F1_MIGR_TRANS.MIGR_DATA_SET_ID) AND BO_STATUS_CD <> 'CANCEL' AND BUS_OBJ_CD = 'F1-MigrTransactionImport' AND BO_STATUS_CD IN (SELECT BO_STATUS_CD FROM F1_BUS_OBJ_STATUS BO WHERE BO.BUS_OBJ_CD = F1_MIGR_TRANS.BUS_OBJ_CD AND BO.BO_STATUS_COND_FLG <> 'F1FL')
/

UPDATE F1_MIGR_OBJ SET BO_STATUS_CD = 'CANCEL' WHERE EXISTS(SELECT 'x' FROM F1_MIGR_DATA_ST DS WHERE DS.BO_STATUS_CD = 'CANCEL' AND DS.MIGR_DATA_SET_ID = F1_MIGR_OBJ.MIGR_DATA_SET_ID) AND BO_STATUS_CD <> 'CANCEL' AND BUS_OBJ_CD = 'F1-MigrObjectImport' AND BO_STATUS_CD IN (SELECT BO_STATUS_CD FROM F1_BUS_OBJ_STATUS BO WHERE BO.BUS_OBJ_CD = F1_MIGR_OBJ.BUS_OBJ_CD AND BO.BO_STATUS_COND_FLG <> 'F1FL')
/

UPDATE CI_BATCH_CTRL_P SET BATCH_PARM_VAL = 'true' WHERE BATCH_CD = 'F1-MGDPR' AND SEQ_NUM = '20' AND BATCH_PARM_VAL = ' '
/

UPDATE CI_BATCH_CTRL_P SET REQUIRED_SW = 'Y' WHERE BATCH_CD = 'F1-MGDPR' AND SEQ_NUM = 60 AND REQUIRED_SW = 'N'
/

UPDATE F1_BUS_OBJ_STATUS SET BATCH_CD = ' ' WHERE BUS_OBJ_CD = 'F1-MigrDataSetImport' AND BO_STATUS_CD = 'READY2APPLY' AND BATCH_CD = 'F1-MGDPR'
/

UPDATE F1_BUS_OBJ_STATUS SET BATCH_CD = 'F1-MGDIM' WHERE BUS_OBJ_CD = 'F1-MigrDataSetImport' AND BO_STATUS_CD = 'PENDING' AND BATCH_CD = 'F1-MGDPR'
/

UPDATE F1_BUS_OBJ_STATUS SET BATCH_CD = 'F1-MGDIM' WHERE BUS_OBJ_CD = 'F1-MigrDataSetImport' AND BO_STATUS_CD = 'READY2COMP' AND BATCH_CD = ' '
/

UPDATE F1_BUS_OBJ_STATUS SET BATCH_CD = 'F1-MGOAP' WHERE BUS_OBJ_CD = 'F1-MigrObjectImport' AND BO_STATUS_CD = 'APPROVED' AND BATCH_CD = ' '
/

UPDATE F1_BUS_OBJ_STATUS SET BATCH_CD = 'F1-MGOPR' WHERE BUS_OBJ_CD = 'F1-MigrObjectImport' AND BO_STATUS_CD = 'APPLIEDERROR' AND BATCH_CD = ' '
/

UPDATE F1_BUS_OBJ_STATUS SET BATCH_CD = 'F1-MGOPR' WHERE BUS_OBJ_CD = 'F1-MigrObjectImport' AND BO_STATUS_CD = 'PENDING' AND BATCH_CD = ' '
/

UPDATE F1_BUS_OBJ_STATUS SET BATCH_CD = 'F1-MGTAP' WHERE BUS_OBJ_CD = 'F1-MigrTransactionImport' AND BO_STATUS_CD = 'READY2APPLY' AND BATCH_CD = ' '
/

UPDATE F1_BUS_OBJ_STATUS SET BATCH_CD = 'F1-MGTPR' WHERE BUS_OBJ_CD = 'F1-MigrTransactionImport' AND BO_STATUS_CD = 'APPLIEDERROR' AND BATCH_CD = ' '
/

UPDATE F1_BUS_OBJ_STATUS SET BATCH_CD = 'F1-MGTPR' WHERE BUS_OBJ_CD = 'F1-MigrTransactionImport' AND BO_STATUS_CD = 'PENDING' AND BATCH_CD = ' '
/

UPDATE F1_BUS_OBJ_STATUS SET SORT_SEQ5 = 15 WHERE BUS_OBJ_CD = 'F1-MigrDataSetImport' AND BO_STATUS_CD = 'CANCEL' AND SORT_SEQ5 = 60
/

UPDATE F1_BUS_OBJ_STATUS SET SORT_SEQ5 = 20 WHERE BUS_OBJ_CD = 'F1-MigrDataSetExport' AND BO_STATUS_CD = 'SETUPDATA' AND SORT_SEQ5 = 3
/

UPDATE F1_BUS_OBJ_STATUS SET SORT_SEQ5 = 30 WHERE BUS_OBJ_CD = 'F1-MigrDataSetExport' AND BO_STATUS_CD = 'ERROR' AND SORT_SEQ5 = 2
/

UPDATE F1_BUS_OBJ_STATUS SET SORT_SEQ5 = 60 WHERE BUS_OBJ_CD = 'F1-MigrDataSetExport' AND BO_STATUS_CD = 'EXPORTED' AND SORT_SEQ5 = 6
/

UPDATE F1_BUS_OBJ_STATUS SET SORT_SEQ5 = 75 WHERE BUS_OBJ_CD = 'F1-MigrObjectImport' AND BO_STATUS_CD = 'CANNOTAPPLY' AND SORT_SEQ5 = 50
/

UPDATE F1_BUS_OBJ_STATUS SET STATUS_REASON_FLG = 'F1OT' WHERE BUS_OBJ_CD = 'F1-MigrDataSetExport' AND BO_STATUS_CD = 'CANCEL' AND STATUS_REASON_FLG = ' '
/

UPDATE F1_BUS_OBJ_STATUS SET STATUS_REASON_FLG = 'F1OT' WHERE BUS_OBJ_CD = 'F1-MigrDataSetImport' AND BO_STATUS_CD = 'CANCEL' AND STATUS_REASON_FLG = ' '
/