Postgresql, Autocommit, Oracle.
language plpgsql; call my_inserts(10,12); call my_inserts(5,15); select * from DEMO; \q Here the rows 5 to 9 have been committed before encountering the exception for row 10. Still, no need for an explicit BEGIN here. The COMMIT in the loop will end the transaction (started implicitly on the server