INSERT INTO controlsum SELECT DISTINCT controlsvia0.ATTR_0,controlsvia0.ATTR_2, SUM(controlsvia0.ATTR_3) FROM controlsvia controlsvia0 WHERE (controlsvia0.ATTR_0,controlsvia0.ATTR_2) NOT IN (SELECT ATTR_0,ATTR_1 FROM controlsum) GROUP BY controlsvia0.ATTR_0,controlsvia0.ATTR_2; c := c + SQL%ROWCOUNT; COMMIT; IF c = 0 THEN EXIT; END IF; END LOOP; END; /
{}