__IF_EXISTS__
SELECT 1
 FROM CI_UT_INSTL_DTL
WHERE SCRIPT_FILE_NAME = 'FW44020_APDATA_OUAF-13262.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__


__IF_EXISTS__
SELECT 1 FROM CI_WFM WHERE EXT_SYS_TYP_FLG = 'F1EM'
/
__THEN__

INSERT INTO CI_WFM_OPT (WFM_NAME,SEQ_NUM,EXT_OPT_TYPE,WFM_OPT_VAL,VERSION)
SELECT WFM_NAME, 10, 'F1XL', 'F1FL',1
FROM CI_WFM A WHERE A.EXT_SYS_TYP_FLG = 'F1EM' AND NOT EXISTS (SELECT 'X' FROM CI_WFM_OPT B WHERE A.WFM_NAME = B.WFM_NAME AND B.EXT_OPT_TYPE = 'F1XL')
/

__ELSE__

INSERT INTO CI_WFM (WFM_NAME, EXT_SYS_TYP_FLG, VERSION)  VALUES ('EXT_MSG_CFG', 'F1EM', 1)
/

INSERT INTO CI_WFM_L (WFM_NAME, LANGUAGE_CD, DESCR, VERSION)  VALUES ('EXT_MSG_CFG', 'ENG', 'External Message Options', 1)
/

INSERT INTO CI_WFM_OPT (WFM_NAME,SEQ_NUM,EXT_OPT_TYPE,WFM_OPT_VAL,VERSION) VALUES ('EXT_MSG_CFG',10, 'F1XL', 'F1FL',1)
/

__ENDIF__



















