Hi Tom
I am having 1000 inserts in my procedure and if 100th insert fails, how will i handle that?
Ideally i need to bypass that 100th one and continue till end.
Code example:-
Begin
insert into table () values();
insert into table () values();
.
.
.
commit;
end;
Use DML error logging:
create table t (
c1 int primary key
);
exec dbms_errlog.create_error_log (dml_table_name => 't');
begin
insert into t values ( 1 )
log errors reject limit unlimited;
insert into t values ( 2 )
log errors reject limit unlimited;
insert into t values ( 1 )
log errors reject limit unlimited;
insert into t values ( 'a' )
log errors reject limit unlimited;
insert into t values ( 3 )
log errors reject limit unlimited;
end;
/
select * from t;
C1
1
2
3
select c1, ora_err_mesg$
from err$_t;
C1 ORA_ERR_MESG$
1 ORA-00001: unique constraint (CHRIS.SYS_C0019292) violated
a ORA-01722: invalid number