__IF_EXISTS__
SELECT 1
  FROM CI_UT_INSTL_DTL
 WHERE SCRIPT_FILE_NAME = 'FW420_APDATA1.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 CI_MD_PRG_COM
SET OWNER_FLG='F1'
WHERE PROG_COM_ID = 'CIPYPGDJ'
/


UPDATE CI_CHAR_ENTITY
SET OWNER_FLG='F1'
WHERE CHAR_ENTITY_FLG = 'F1FL'
AND CHAR_TYPE_CD = 'F1-TODO'
/


UPDATE CI_CHAR_TYPE SET CUSTOM_SW = 'N' WHERE RTRIM(CUSTOM_SW) IS NULL 
/ 

UPDATE CI_MD_MO SET PROG_COM_ID = 'CIPYPGDJ' WHERE RTRIM(PROG_COM_ID) IS NULL 
/ 

UPDATE F1_BUS_OBJ_STATUS
SET SORT_SEQ5 = 0,
    BO_STATUS_COND_FLG = ' ',
    ACCESS_MODE = ' ',
    BATCH_CD = ' ',
    BO_ALERT_FLG = ' ',
    BO_TRANSITORY_FLG = ' '
WHERE BUS_OBJ_CD IN (SELECT BUS_OBJ_CD FROM F1_BUS_OBJ WHERE RTRIM(PARENT_BO_CD) IS NOT NULL AND UPPER(bus_obj_cd) NOT LIKE 'ZZ%' )
/

UPDATE F1_BUS_OBJ_STATUS_L
SET DESCR = ' ',
    DESCR254 = ' ',
    DESCRLONG = ' '
WHERE BUS_OBJ_CD IN (SELECT BUS_OBJ_CD FROM F1_BUS_OBJ WHERE RTRIM(PARENT_BO_CD) IS NOT NULL AND UPPER(bus_obj_cd) NOT LIKE 'ZZ%' )
/

UPDATE CI_FK_REF SET ZONE_CD = 'F1-BOMOSRC' WHERE FK_REF_CD = 'C1-BOMO' 
/ 


