__IF_EXISTS__
SELECT 1
  FROM CI_UT_INSTL_DTL
WHERE SCRIPT_FILE_NAME = 'FW43060_POSTDATA_OUAF-7925.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_COUNTRY SET ADDR1_USG_FLG = (CASE WHEN ADDR1_AVAIL = 'N' THEN 'NA' WHEN ADDR1_AVAIL = 'Y' THEN 'OPT' END)
/
UPDATE CI_COUNTRY SET ADDR2_USG_FLG = (CASE WHEN ADDR2_AVAIL = 'N' THEN 'NA' WHEN ADDR2_AVAIL = 'Y' THEN 'OPT' END)
/
UPDATE CI_COUNTRY SET ADDR3_USG_FLG = (CASE WHEN ADDR3_AVAIL = 'N' THEN 'NA' WHEN ADDR3_AVAIL = 'Y' THEN 'OPT' END)
/
UPDATE CI_COUNTRY SET ADDR4_USG_FLG = (CASE WHEN ADDR4_AVAIL = 'N' THEN 'NA' WHEN ADDR4_AVAIL = 'Y' THEN 'OPT' END)
/
UPDATE CI_COUNTRY SET CITY_USG_FLG = (CASE WHEN CITY_AVAIL = 'N' THEN 'NA' WHEN CITY_AVAIL = 'Y' THEN 'OPT' END)
/
UPDATE CI_COUNTRY SET COUNTY_USG_FLG = (CASE WHEN COUNTY_AVAIL  = 'N' THEN 'NA' WHEN COUNTY_AVAIL  = 'Y' THEN 'OPT' END)
/
UPDATE CI_COUNTRY SET GEO_CODE_USG_FLG = (CASE WHEN GEO_CODE_AVAIL = 'N' THEN 'NA' WHEN GEO_CODE_AVAIL = 'Y' THEN 'OPT' END)
/
UPDATE CI_COUNTRY SET HOUSE_TYPE_USG_FLG = (CASE WHEN HOUSE_TYPE_AVAIL = 'N' THEN 'NA' WHEN HOUSE_TYPE_AVAIL = 'Y' THEN 'OPT' END)
/
UPDATE CI_COUNTRY SET IN_CITY_LIM_USG_FLG = (CASE WHEN IN_CITY_LIM_AVAIL = 'N' THEN 'NA' WHEN IN_CITY_LIM_AVAIL = 'Y' THEN 'OPT' END)
/
UPDATE CI_COUNTRY SET NUM1_USG_FLG = (CASE WHEN NUM1_AVAIL = 'N' THEN 'NA' WHEN NUM1_AVAIL = 'Y' THEN 'OPT' END)
/
UPDATE CI_COUNTRY SET NUM2_USG_FLG = (CASE WHEN NUM2_AVAIL = 'N' THEN 'NA' WHEN NUM2_AVAIL = 'Y' THEN 'OPT' END)
/
UPDATE CI_COUNTRY SET POSTAL_USG_FLG = (CASE WHEN POSTAL_AVAIL = 'N' THEN 'NA' WHEN POSTAL_AVAIL = 'Y' THEN 'OPT' END)
/
UPDATE CI_COUNTRY SET STATE_USG_FLG = (CASE WHEN STATE_AVAIL = 'N' THEN 'NA' WHEN STATE_AVAIL = 'Y' THEN 'OPT' END)
/
