__IF_EXISTS__
SELECT 1
  FROM CI_UT_INSTL_DTL
WHERE SCRIPT_FILE_NAME = 'FW43040_POSTDATA2.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_BATCH_CTRL SET APP_SVC_ID = 'F1-DFLTAPS' WHERE APP_SVC_ID = ' '
/
INSERT INTO SC_USR_GRP_PROF (USR_GRP_ID, APP_SVC_ID, EXPIRATION_DT, VERSION, OWNER_FLG) SELECT DISTINCT sc.USR_GRP_ID, ci.APP_SVC_ID, sc.EXPIRATION_DT,1, sc.OWNER_FLG  FROM SC_USR_GRP_PROF sc, CI_BATCH_CTRL ci WHERE sc.USR_GRP_ID <> 'ALL_SERVICES' AND sc.APP_SVC_ID='CILZRBPP' AND ci.OWNER_FLG ='F1' AND NOT EXISTS ( SELECT USR_GRP_ID FROM SC_USR_GRP_PROF WHERE APP_SVC_ID = ci.APP_SVC_ID AND USR_GRP_ID=sc.USR_GRP_ID )
/
INSERT INTO SC_ACCESS_CNTL (USR_GRP_ID, APP_SVC_ID, ACCESS_MODE, VERSION, OWNER_FLG)SELECT DISTINCT sa.USR_GRP_ID, ci.APP_SVC_ID, 'F1EX',1,sa.OWNER_FLG FROM CI_BATCH_CTRL ci, SC_ACCESS_CNTL sa WHERE sa.USR_GRP_ID <> 'ALL_SERVICES' AND sa.APP_SVC_ID='CILZRBPP' AND ci.OWNER_FLG ='F1' AND sa.ACCESS_MODE='A' AND NOT EXISTS (SELECT USR_GRP_ID FROM SC_ACCESS_CNTL  WHERE ACCESS_MODE='F1EX' AND APP_SVC_ID = ci.APP_SVC_ID AND USR_GRP_ID=sa.USR_GRP_ID )
/

 
