declare i number(4);
begin
i:=1;
while( i<100)
loop
update pms_node n set n.brandcount=(select count(*) from pms_brand b where b.nodeid=i) where n.id=i;
i:=i+1;
end loop;
end;
declare i number(4);
begin
i:=1;
while( i<100)
loop
update pms_node n set n.brandcount=(select count(*) from pms_brand b where b.nodeid=i) where n.id=i;
i:=i+1;
end loop;
end;