--存储过程
declare
i number;
begin
i := 0;
for v_customer in (select t.cust_level_name,c.code from TEMP_HBS_ESOPCUSLEV t,x_customer c where t.unit_id = c.code) loop
begin
UPDATE x_customer c SET c.grade=v_customer.cust_level_name WHERE c.code=v_customer.code;
i := i + 1;
if (i > 1000) then
commit;
i := 0;
end if;
end;
end loop;
commit;
end;
-- 坐标刷新
declare
i number;
begin
i := 0;
for v_customer in (select a.lng ,a.lat,a.name,a.id from xb_community_map4 a where
exists (select b.name from xb_community_map b WHERE a.name=b.name and a.yxid=b.yxid and a.address=b.address and a.gxid=b.gxid))
loop
begin
UPDATE xb_community_map xb SET xb.lng =v_customer.lng,xb.lat=v_customer.lat WHERE xb.name in(v_customer.name);
i := i + 1;
if (i > 1000) then
commit;
i := 0;
end if;
end;
end loop;
commit;
end;
---验证查询
SELECT a.name,a.lng,a.lat,a.gxid,a.yxid,a.address FROM xb_community_map a WHERE a.name ='凤凰花园城';
sql批量更新数据存过
最新推荐文章于 2023-09-20 13:54:26 发布