I am using Oracle 12C. If my insert statement fails with ORA-01438 how do I capture the column causing the error. For example see below code -
create table T1 ( c1 number(3,2) , c2 number(4,2), c3 number(5,2) );
insert into T1 ( c1 ,c2, c3) values ( 1, 22,333); --good
commit;
insert into T1 ( c1 ,c2, c3) values ( 1, 22,3330); --ORA-01438 for c1
insert into T1 ( c1 ,c2, c3) values ( 1, 222,3330); ---ORA-01438 for c1, c2
insert into T1 ( c1 ,c2, c3) values ( 11, 222,3330); --ORA-01438 for c1, c2, c3
I even tried DBMS_ERRLOG.CREATE_ERROR_LOG but I cannot identify the column causing bad data. Please see below code -
EXECUTE DBMS_ERRLOG.CREATE_ERROR_LOG('T1', 'T1_bad');
insert into T1 ( c1 ,c2, c3) values ( 11, 222,3330);
log errors into T1_bad;
SELECT * FROM T1_bad;
DBMS_ERRLOG. - Kaushik Nayak