The only way (I know) to figure out which line is causing the problem is to use the Oracle log log into function. Thus, insert will not throw an exception, and any line that violates any restriction will be written to the specified error table.
To do this, you first need to create a log table that contains the rejected rows:
EXECUTE DBMS_ERRLOG.CREATE_ERROR_LOG('BD_VEHICLES_TEMP');
This will create a table named ERR$_BD_VEHICLES_TEMP
Then run change your expression to the following:
insert into bd_vehicles_temp select * from bd_vehicles_temp_1 LOG ERRORS REJECT LIMIT UNLIMITED;
The operation will continue even if the line does not check the constraint. After completing the instruction, you can check the contents of the ERR$_BD_VEHICLES_TEMP for rows that violate the restriction, including an error message and values.
(Edit): If you want to stop at the first error (and see this in the log table), leave the REJECT LIMIT UNLIMITED sentence out.
For more information, see the manual:
a_horse_with_no_name
source share