0% found this document useful (0 votes)
8 views

QWQWQWXX

Uploaded by

Debasis Bhuyan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views

QWQWQWXX

Uploaded by

Debasis Bhuyan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

create or replace PROCEDURE debasis_polyupdate_gp AS

v_sql VARCHAR2(1000);
v_sql1 VARCHAR2(1000);

CURSOR CR IS
select m.gp_id,is_cap(m.gp_name)
gp_name,t3.latitude,t3.longitude,t1.poly_dist_code,t2.poly_block_code,t3.gp_code
from tbl_gp_master m join tbl_district_mst a
on m.dist_id = a.district_id join tbl_block_master b
on m.block_id=b.block_id join temp_dist t1
on a.poly_dist_code=t1.poly_dist_code join temp_block t2
on t2.poly_block_code=b.poly_block_code join temp_gp t3
on t3.dist_code=a.poly_dist_code
and t3.block_code=b.poly_block_code
and is_cap(m.gp_name)=is_cap(t3.gp_name)
--and utl_match.edit_distance_similarity(is_cap(m.gp_name),is_cap(t3.gp_name))>95
where m.status_matched is null;

BEGIN
FOR REC IN CR LOOP
UPDATE tbl_gp_master T SET t.gp_latitude= REC.latitude,
t.gp_longitude=rec.longitude,

t.poly_dist_code=rec.poly_dist_code,t.poly_block_code=rec.poly_block_code,t.poly_gp
_code=rec.gp_code,
t.status_matched='100-MATCH'
where t.gp_id=rec.gp_id
and t.status_matched is null;
END LOOP;
COMMIT;

EXCEPTION
WHEN OTHERS THEN
v_sql := substr(sqlcode || sqlerrm, 1, 200);
dbms_output.put_line('SQLCODE => ' || sqlcode);
-- dbms_output.put_line(v_sql);

END;

You might also like