
__IF_EXISTS__
SELECT 1
  FROM CI_INSTALL_PROD
 WHERE INSTALL_OPT_ID = '11111'
   AND OWNER_FLG = 'F1'
/
__ELSE__

__EXIT__

__ENDIF__


INSERT INTO CI_ZONE_PRM SELECT  distinct a.zone_cd,a.zone_hdl_cd, b.zone_hdl_prm_name,' ',1,c.owner_flg,' '
FROM CI_ZONE_HDL_PRM b,
     CI_ZONE_PRM a,
     CI_ZONE c
WHERE a.zone_hdl_cd = b.zone_hdl_cd
   and a.zone_cd = c.zone_cd
  and b.zone_hprm_usg_flg = 'ZONE'
  and b.required_sw = 'N'
  and a.zone_cd not like 'ZZ%'
  and not exists (select 1 from ci_zone_prm d
                                        where d.zone_cd = a.zone_cd
                                          and d.zone_hdl_cd = b.zone_hdl_cd
                                          and d.zone_hdl_prm_name =  b.zone_hdl_prm_name
                         )
/