Rcms Update
Rcms Update
cursor cr is
--select a.lgd_gp_code,upper(a.village_name) village_name_eng from
tbl_village_master a
--where exists (select 1 from temp_temp_village b where b.lgdgpcode=a.lgd_gp_code
--and upper(b.VILLAGE_NAME)=upper(a.VILLAGE_NAME)
----and
utl_match.edit_distance_similarity(upper(b.VILLAGE_NAME),upper(a.VILLAGE_NAME))=p_p
erc and
--and b.spdp_village_name is null and b.spdp_remark is null
--)
select village_name,village_id,lgd_gp_code,spdp_village_name from(
select upper(a.village_name) village_name,b.villageid
village_id,a.lgd_gp_code,b.spdp_village_name
from tbl_village_master a, temp_rcms_village b where a.lgd_gp_code=b.lgdgpcode
--and is_cap(a.village_name)=is_cap(b.village_name)
and
utl_match.edit_distance_similarity(is_cap(b.VILLAGE_NAME),is_cap(a.VILLAGE_NAME))>=
p_perc
) where spdp_village_name is null;
begin
for rec in cr loop
begin
update temp_rcms_village a set a.spdp_village_name=rec.village_name,
a.SPDP_REMARK =p_perc||'-MATCHED'
where a.lgdgpcode=rec.lgd_gp_code and a.villageid=rec.village_id
and a.spdp_village_name is null and a.spdp_remark is null
;
exception when others then
null;
end;
commit;
end loop;
end;