__IF_EXISTS__
SELECT 1
  FROM CI_UT_INSTL_DTL
 WHERE SCRIPT_FILE_NAME = 'FW410_BPSCHEMA13.SQL'
   AND END_DTTM IS NOT NULL
/
__THEN__

__EXIT__

__ENDIF__

__IF_EXISTS__
SELECT 1
  FROM USER_TABLES
 WHERE TABLE_NAME = 'F1_INSTALLATION'
/
__ELSE__

__EXIT__

__ENDIF__


UPDATE CI_XAI_ENV_HNDL_L
SET OWNER_FLG = 'F1'
where UPPER(XAI_ENV_HNDL_ID) = 'DEFAULTHND'
/


update CI_LOOKUP_VAL_L
set owner_flg = 'F1'
where RTRIM(field_name) = 'ACCESS_MODE'
and field_value = 'PE'
/


update CI_LOOKUP_VAL_L
set owner_flg = 'F1'
where RTRIM(FIELD_NAME) = 'ENV_TYPE_FLG'
and RTRIM(FIELD_VALUE) = 'DFLT'
/



update CI_LOOKUP_VAL_L
set owner_flg = 'F1'
where RTRIM(FIELD_NAME) = 'SENDER_CTXT_FLG'
and RTRIM(FIELD_VALUE) in ('APTF','FPNM')
/


UPDATE CI_FK_REF_L SET OWNER_FLG = 'F1' WHERE RTRIM(UPPER(FK_REF_CD)) = 'C1-BOMO'
/


update CI_MD_FLD_L
set owner_flg = 'F1'
WHERE RTRIM(FLD_NAME) IN ('ADDRESS1','ADDRESS2','ADDRESS3','ADDRESS4','BO_DATA_AREA','BO_STATUS_REASON_CD', 
'CITY','COUNTY','LATITUDE','LONGITUDE','POSTAL')
/


update CI_MD_FLD_L
set owner_flg = 'F1'
WHERE RTRIM(FLD_NAME) IN ('GEO_CODE','HOUSE_TYPE','IN_CITY_LIMIT','NUM1','NUM2')
/



update CI_MD_FLD_L
set owner_flg = 'F1'
WHERE RTRIM(FLD_NAME) IN ('ACTION_FLG','EFF_DT')
/



update CI_MD_TBL_FLD_L
set owner_flg = 'F1'
WHERE RTRIM(TBL_NAME) = 'CI_SCR_STEP'
AND RTRIM(FLD_NAME) IN ('HEIGHT','HEIGHT_TYPE_FLG')
/



update CI_MD_TBL_L
set owner_flg = 'F1'
WHERE RTRIM(TBL_NAME) = 'CI_USR_ACC_GRP_VW'
/



update CI_MD_TBL_FLD_L
set owner_flg = 'F1'
WHERE RTRIM(TBL_NAME) = 'CI_USR_ACC_GRP_VW'
/



update CI_MD_FLD_L
set owner_flg = 'F1'
WHERE RTRIM(FLD_NAME) IN ('TRANS_BUS_OBJ_CD')
/


UPDATE CI_DISP_ICON_L
SET OWNER_FLG = (SELECT OWNER_FLG FROM F1_INSTALLATION)
WHERE DISP_ICON_CD IN ('ACCT','ACCTINFO','BILL' ,'BILLCORR' ,'BILLFACT','BILLMSG' ,'FA' ,'METER' ,'PAYEVENT' ,'PERCHILD' ,'PERPAREN' ,'PERSON' ,'PREMISE','RATECOMP' ,'RATESCHD' ,'RATEVER' ,'REGRULE' ,'SA','SP' ,'SQRULE' ,'STMT' ,'STMTC' ,'STMTCD' )
AND OWNER_FLG = 'F1'
/


update ci_md_fld_l set owner_flg = 'F1'
where fld_name in ('CITY_UPR','DESCR_UPR','ADDRESS1_UPR')
/




