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

INSERT INTO CI_INSTALL_ALG (INSTALL_OPT_ID, INS_ALG_ENTITY_FLG, SEQ_NUM, ALG_CD, VERSION) select '11111', 'F1HC', NVL((Select max(SEQ_NUM)+1 from CI_INSTALL_ALG where INSTALL_OPT_ID = '11111' and INS_ALG_ENTITY_FLG = 'F1HC'),1) as SEQ_NUM, 'F1-HCBLOS', '1' from dual WHERE NOT EXISTS (SELECT 'X' FROM CI_INSTALL_ALG WHERE INS_ALG_ENTITY_FLG = 'F1HC' AND ALG_CD = 'F1-HCBLOS')
/