__IF_EXISTS__
SELECT 1
  FROM CI_UT_INSTL_DTL
WHERE SCRIPT_FILE_NAME = 'FW45010_POSTDATA_UGBUPD-1185A.SQL'
   AND END_DTTM IS NOT NULL
/
__THEN__
__EXIT__
__ENDIF__

INSERT INTO CI_BATCH_CTRL_P (BATCH_CD,SEQ_NUM,BATCH_PARM_NAME,BATCH_PARM_VAL,REQUIRED_SW,OWNER_FLG,TEXT_SECURITY_FLG) 
SELECT BC.BATCH_CD,NVL2((SELECT BCP.BATCH_CD FROM CI_BATCH_CTRL_P BCP WHERE BCP.BATCH_CD = BC.BATCH_CD AND BCP.SEQ_NUM =895),896,895) AS SEQ_NUM ,'encryptExternalKey',' ','N',BC.OWNER_FLG,' ' 
FROM CI_BATCH_CTRL BC 
WHERE TRIM(BC.PROGRAM_NAME) = 'com.splwg.base.domain.batch.pluginDriven.PluginDrivenExtractProcess' 
AND NOT EXISTS (SELECT 'X' FROM CI_BATCH_CTRL_P BCP 
WHERE BCP.BATCH_CD = BC.BATCH_CD AND BCP.BATCH_PARM_NAME = 'encryptExternalKey')


/

INSERT INTO CI_BATCH_CTRL_P (BATCH_CD,SEQ_NUM,BATCH_PARM_NAME,BATCH_PARM_VAL,REQUIRED_SW,OWNER_FLG,TEXT_SECURITY_FLG) 
SELECT BC.BATCH_CD,NVL2((SELECT BCP.BATCH_CD FROM CI_BATCH_CTRL_P BCP WHERE BCP.BATCH_CD = BC.BATCH_CD AND BCP.SEQ_NUM =896),897,896) AS SEQ_NUM ,'encryptSignatureKey',' ','N',BC.OWNER_FLG,' ' 
FROM CI_BATCH_CTRL BC 
WHERE TRIM(BC.PROGRAM_NAME) = 'com.splwg.base.domain.batch.pluginDriven.PluginDrivenExtractProcess' 
AND NOT EXISTS (SELECT 'X' FROM CI_BATCH_CTRL_P BCP 
WHERE BCP.BATCH_CD = BC.BATCH_CD AND BCP.BATCH_PARM_NAME = 'encryptSignatureKey')


/

INSERT INTO CI_BATCH_CTRL_P_L (BATCH_CD, SEQ_NUM, LANGUAGE_CD, DESCR50, DESCRLONG, VERSION, OWNER_FLG) SELECT BCP.BATCH_CD, BCP.SEQ_NUM, 'ENG', tmplvw.DESCR50, tmplvw.DESCRLONG, 1, BCP.OWNER_FLG FROM CI_BATCH_CTRL_P BCP, (select DESCR50, DESCRLONG from CI_BATCH_CTRL_P TMPL, CI_BATCH_CTRL_P_L TMPLL  where TMPL.BATCH_CD = 'F1-PDBEX' and TMPL.BATCH_PARM_NAME = 'encryptExternalKey' and TMPL.BATCH_CD = TMPLL.BATCH_CD and TMPL.SEQ_NUM = TMPLL.SEQ_NUM and TMPLL.LANGUAGE_CD = 'ENG') tmplvw WHERE BCP.BATCH_PARM_NAME = 'encryptExternalKey' AND NOT EXISTS (SELECT 'X' FROM CI_BATCH_CTRL_P_L BCPL WHERE BCPL.LANGUAGE_CD = 'ENG' AND BCPL.BATCH_CD = BCP.BATCH_CD AND BCPL.SEQ_NUM = BCP.SEQ_NUM)

/


INSERT INTO CI_BATCH_CTRL_P_L (BATCH_CD, SEQ_NUM, LANGUAGE_CD, DESCR50, DESCRLONG, VERSION, OWNER_FLG) SELECT BCP.BATCH_CD, BCP.SEQ_NUM, 'ENG', tmplvw.DESCR50, tmplvw.DESCRLONG, 1, BCP.OWNER_FLG FROM CI_BATCH_CTRL_P BCP, (select DESCR50, DESCRLONG from CI_BATCH_CTRL_P TMPL, CI_BATCH_CTRL_P_L TMPLL  where TMPL.BATCH_CD = 'F1-PDBEX' and TMPL.BATCH_PARM_NAME = 'encryptSignatureKey' and TMPL.BATCH_CD = TMPLL.BATCH_CD and TMPL.SEQ_NUM = TMPLL.SEQ_NUM and TMPLL.LANGUAGE_CD = 'ENG') tmplvw WHERE BCP.BATCH_PARM_NAME = 'encryptSignatureKey' AND NOT EXISTS (SELECT 'X' FROM CI_BATCH_CTRL_P_L BCPL WHERE BCPL.LANGUAGE_CD = 'ENG' AND BCPL.BATCH_CD = BCP.BATCH_CD AND BCPL.SEQ_NUM = BCP.SEQ_NUM)

/


INSERT INTO CI_BATCH_CTRL_P (BATCH_CD,SEQ_NUM,BATCH_PARM_NAME,BATCH_PARM_VAL,REQUIRED_SW,OWNER_FLG,TEXT_SECURITY_FLG) 
SELECT BC.BATCH_CD,NVL2((SELECT BCP.BATCH_CD FROM CI_BATCH_CTRL_P BCP WHERE BCP.BATCH_CD = BC.BATCH_CD AND BCP.SEQ_NUM =90),91,90) AS SEQ_NUM ,'encryptExternalKey',' ','N',BC.OWNER_FLG,' ' 
FROM CI_BATCH_CTRL BC 
WHERE TRIM(BC.PROGRAM_NAME) = 'com.splwg.base.domain.dataExport.initialExportBatch.InitialExportBatchProcess' 
AND NOT EXISTS (SELECT 'X' FROM CI_BATCH_CTRL_P BCP 
WHERE BCP.BATCH_CD = BC.BATCH_CD AND BCP.BATCH_PARM_NAME = 'encryptExternalKey')


/

INSERT INTO CI_BATCH_CTRL_P (BATCH_CD,SEQ_NUM,BATCH_PARM_NAME,BATCH_PARM_VAL,REQUIRED_SW,OWNER_FLG,TEXT_SECURITY_FLG) 
SELECT BC.BATCH_CD,NVL2((SELECT BCP.BATCH_CD FROM CI_BATCH_CTRL_P BCP WHERE BCP.BATCH_CD = BC.BATCH_CD AND BCP.SEQ_NUM =100),101,100) AS SEQ_NUM ,'encryptSignatureKey',' ','N',BC.OWNER_FLG,' ' 
FROM CI_BATCH_CTRL BC 
WHERE TRIM(BC.PROGRAM_NAME) = 'com.splwg.base.domain.dataExport.initialExportBatch.InitialExportBatchProcess' 
AND NOT EXISTS (SELECT 'X' FROM CI_BATCH_CTRL_P BCP 
WHERE BCP.BATCH_CD = BC.BATCH_CD AND BCP.BATCH_PARM_NAME = 'encryptSignatureKey')


/

INSERT INTO CI_BATCH_CTRL_P_L (BATCH_CD, SEQ_NUM, LANGUAGE_CD, DESCR50, DESCRLONG, VERSION, OWNER_FLG) SELECT BCP.BATCH_CD, BCP.SEQ_NUM, 'ENG', tmplvw.DESCR50, tmplvw.DESCRLONG, 1, BCP.OWNER_FLG FROM CI_BATCH_CTRL_P BCP, (select DESCR50, DESCRLONG from CI_BATCH_CTRL_P TMPL, CI_BATCH_CTRL_P_L TMPLL  where TMPL.BATCH_CD = 'F1-GEIXP' and TMPL.BATCH_PARM_NAME = 'encryptExternalKey' and TMPL.BATCH_CD = TMPLL.BATCH_CD and TMPL.SEQ_NUM = TMPLL.SEQ_NUM and TMPLL.LANGUAGE_CD = 'ENG') tmplvw WHERE BCP.BATCH_PARM_NAME = 'encryptExternalKey' AND NOT EXISTS (SELECT 'X' FROM CI_BATCH_CTRL_P_L BCPL WHERE BCPL.LANGUAGE_CD = 'ENG' AND BCPL.BATCH_CD = BCP.BATCH_CD AND BCPL.SEQ_NUM = BCP.SEQ_NUM)

/


INSERT INTO CI_BATCH_CTRL_P_L (BATCH_CD, SEQ_NUM, LANGUAGE_CD, DESCR50, DESCRLONG, VERSION, OWNER_FLG) SELECT BCP.BATCH_CD, BCP.SEQ_NUM, 'ENG', tmplvw.DESCR50, tmplvw.DESCRLONG, 1, BCP.OWNER_FLG FROM CI_BATCH_CTRL_P BCP, (select DESCR50, DESCRLONG from CI_BATCH_CTRL_P TMPL, CI_BATCH_CTRL_P_L TMPLL  where TMPL.BATCH_CD = 'F1-GEIXP' and TMPL.BATCH_PARM_NAME = 'encryptSignatureKey' and TMPL.BATCH_CD = TMPLL.BATCH_CD and TMPL.SEQ_NUM = TMPLL.SEQ_NUM and TMPLL.LANGUAGE_CD = 'ENG') tmplvw WHERE BCP.BATCH_PARM_NAME = 'encryptSignatureKey' AND NOT EXISTS (SELECT 'X' FROM CI_BATCH_CTRL_P_L BCPL WHERE BCPL.LANGUAGE_CD = 'ENG' AND BCPL.BATCH_CD = BCP.BATCH_CD AND BCPL.SEQ_NUM = BCP.SEQ_NUM)

/


INSERT INTO CI_BATCH_CTRL_P (BATCH_CD,SEQ_NUM,BATCH_PARM_NAME,REQUIRED_SW,OWNER_FLG,TEXT_SECURITY_FLG) 
SELECT BC.BATCH_CD,NVL2((SELECT BCP.BATCH_CD FROM CI_BATCH_CTRL_P BCP WHERE BCP.BATCH_CD = BC.BATCH_CD AND BCP.SEQ_NUM =860),861,860) AS SEQ_NUM ,'decryptInternalKey','N',BC.OWNER_FLG,' ' 
FROM CI_BATCH_CTRL BC 
WHERE TRIM(BC.PROGRAM_NAME) = 'com.splwg.base.domain.batch.pluginDriven.PluginDrivenUploadProcess' 
AND NOT EXISTS (SELECT 'X' FROM CI_BATCH_CTRL_P BCP WHERE BCP.BATCH_CD = BC.BATCH_CD AND BCP.BATCH_PARM_NAME = 'decryptInternalKey')

/

INSERT INTO CI_BATCH_CTRL_P (BATCH_CD,SEQ_NUM,BATCH_PARM_NAME,REQUIRED_SW,OWNER_FLG,TEXT_SECURITY_FLG) 
SELECT BC.BATCH_CD,NVL2((SELECT BCP.BATCH_CD FROM CI_BATCH_CTRL_P BCP WHERE BCP.BATCH_CD = BC.BATCH_CD AND BCP.SEQ_NUM =870),871,870) AS SEQ_NUM ,'decryptSignatureKey','N',BC.OWNER_FLG,' ' 
FROM CI_BATCH_CTRL BC 
WHERE TRIM(BC.PROGRAM_NAME) = 'com.splwg.base.domain.batch.pluginDriven.PluginDrivenUploadProcess' 
AND NOT EXISTS (SELECT 'X' FROM CI_BATCH_CTRL_P BCP WHERE BCP.BATCH_CD = BC.BATCH_CD AND BCP.BATCH_PARM_NAME = 'decryptSignatureKey')
/


INSERT INTO CI_BATCH_CTRL_P_L (BATCH_CD, SEQ_NUM, LANGUAGE_CD, DESCR50, DESCRLONG, VERSION, OWNER_FLG) SELECT BCP.BATCH_CD, BCP.SEQ_NUM, 'ENG', tmplvw.DESCR50, tmplvw.DESCRLONG, 1, BCP.OWNER_FLG FROM CI_BATCH_CTRL_P BCP, (select DESCR50, DESCRLONG from CI_BATCH_CTRL_P TMPL, CI_BATCH_CTRL_P_L TMPLL  where TMPL.BATCH_CD = 'F1-PDUPL' and TMPL.BATCH_PARM_NAME = 'decryptInternalKey' and TMPL.BATCH_CD = TMPLL.BATCH_CD and TMPL.SEQ_NUM = TMPLL.SEQ_NUM and TMPLL.LANGUAGE_CD = 'ENG') tmplvw WHERE BCP.BATCH_PARM_NAME = 'decryptInternalKey' AND NOT EXISTS (SELECT 'X' FROM CI_BATCH_CTRL_P_L BCPL WHERE BCPL.LANGUAGE_CD = 'ENG' AND BCPL.BATCH_CD = BCP.BATCH_CD AND BCPL.SEQ_NUM = BCP.SEQ_NUM)

/

INSERT INTO CI_BATCH_CTRL_P_L (BATCH_CD, SEQ_NUM, LANGUAGE_CD, DESCR50, DESCRLONG, VERSION, OWNER_FLG) SELECT BCP.BATCH_CD, BCP.SEQ_NUM, 'ENG', tmplvw.DESCR50, tmplvw.DESCRLONG, 1, BCP.OWNER_FLG FROM CI_BATCH_CTRL_P BCP, (select DESCR50, DESCRLONG from CI_BATCH_CTRL_P TMPL, CI_BATCH_CTRL_P_L TMPLL  where TMPL.BATCH_CD = 'F1-PDUPL' and TMPL.BATCH_PARM_NAME = 'decryptSignatureKey' and TMPL.BATCH_CD = TMPLL.BATCH_CD and TMPL.SEQ_NUM = TMPLL.SEQ_NUM and TMPLL.LANGUAGE_CD = 'ENG') tmplvw WHERE BCP.BATCH_PARM_NAME = 'decryptSignatureKey' AND NOT EXISTS (SELECT 'X' FROM CI_BATCH_CTRL_P_L BCPL WHERE BCPL.LANGUAGE_CD = 'ENG' AND BCPL.BATCH_CD = BCP.BATCH_CD AND BCPL.SEQ_NUM = BCP.SEQ_NUM)

/