declare
v_sql long;
V_TABNAME varchar2(100);
v_cont number;
type cursor_type is ref cursor;
cursor u_cursor_item is
select owner || '.' || segment_name from yuzh_test where dcunt is null;
begin
open u_cursor_item;
loop
fetch u_cursor_item
into V_TABNAME;
exit when u_cursor_item%notfound;
begin
v_sql := 'select count(*) from ' || V_TABNAME;
EXECUTE IMMEDIATE v_sql into v_cont;
EXCEPTION
WHEN OTHERS THEN
v_cont :=-1;
end;
update yuzh_test
set dcunt = v_cont
where owner || '.' || segment_name = V_TABNAME;
commit;
end loop;
end;