DECLARE
CURSOR cur IS
SELECT a.ROWID from test1 a where a.id > 100 ORDER BY a.ROWID;
V_COUNTER NUMBER;
BEGIN
V_COUNTER := 0;
FOR row IN cur LOOP
UPDATE test1 SET id = 9999 WHERE ROWID = row.ROWID;
V_COUNTER := V_COUNTER + 1;
IF (V_COUNTER >= 10000) THEN
COMMIT;
V_COUNTER := 0;
END IF;
END LOOP;
COMMIT;
END;