__IF_EXISTS__
SELECT 1
  FROM CI_UT_INSTL_DTL
WHERE SCRIPT_FILE_NAME = 'FW43001_POSTDATA8.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 SC_USR_GRP_PROF (USR_GRP_ID, APP_SVC_ID, EXPIRATION_DT, VERSION, OWNER_FLG) select USR_GRP_ID, 'F1_USRFAVSCH' APP_SVC_ID, TO_DATE('01-01-2100', 'DD-MM-YYYY') EXPIRATION_DT, 1 VERSION, OWNER_FLG from SC_USER_GROUP USRG where not exists (select 'x' from SC_USR_GRP_PROF APS where USRG.USR_GRP_ID = APS.USR_GRP_ID and APP_SVC_ID = 'F1_USRFAVSCH')
/

INSERT INTO SC_ACCESS_CNTL (USR_GRP_ID, APP_SVC_ID, ACCESS_MODE, VERSION, OWNER_FLG) select USR_GRP_ID, 'F1_USRFAVSCH' APP_SVC_ID, 'R' ACCESS_MODE, 1 VERSION, OWNER_FLG from SC_USR_GRP_PROF USRG where APP_SVC_ID = 'F1_USRFAVSCH' and not exists (select 'x' from SC_ACCESS_CNTL APS where USRG.USR_GRP_ID = APS.USR_GRP_ID and APP_SVC_ID = 'F1_USRFAVSCH' and ACCESS_MODE = 'R')
/


