declare
cursor c is
select zzbh from dz_zzxx;
cursor h is
select hh from ry_hxx;
d_zzbh varchar2(30);
h_hh varchar2(30);
i number(1);
begin
open c;
open h;
fetch h
into h_hh;
loop
fetch c
into d_zzbh;
exit when c%notfound;
loop
i := 1;
exit when h%notfound;
fetch h
into h_hh;
update ry_hxx set zzbh = d_zzbh where hh = h_hh;
commit;
i := 0;
if i = 0 then
exit;
end if;
end loop;
end loop;
close c;
end;
/