We can't use rownum ,the inserted records may or may not get last 500 row numbers . Use your original SQL to delete your records ...