Getting record row/column which caused error using pandas to_sql

Viewed 172

I am using pandas to_sql to insert records in oracle table. I would like to know which row (and column) caused error when the insert failed. Is there a way to get that particular record which was the source of error?

When I catch the exception

except Exception as e:

e has this object

DatabaseError('(cx_Oracle.DatabaseError) ORA-01722: invalid number')

I can know from this that it was an invalid number (a string was passed) to a number column but how do I know which row/column?

0 Answers
Related