SAVE EXCEPTIONS in FORALL allows us to process each and every element in the binding collection, even if Oracle raises an exception along the way.
When FORALL is done, Oracle raises the -24381 error and fills up the SQL%BULK_EXCEPTIONS pseudo-collection of records with two pieces of information (fields) for every error encountered:
ERROR_INDEX - the index on which the error was raised. This points back to the binding collection
ERROR_CODE - the Oracle error code that was raised
That's all great -- EXCEPT that what Oracle should be doing is saving the error message; after all, it contains the error code, plus other, critical information. With just the error code, that information is lost.
|