Database trace for a target - using the bad data adapter command (-BADDATA)
About this task
The following database trace example was produced using the same map and data as in the preceding example, now additionally using -BADDATA.
.
.
Error in: oexec
Message : ORA-01400: cannot insert NULL into
("EVENTMGT"."MEMBERSHIP"."LASTNAME")
The following values were being inserted:
Column 1 MEMBERID : D190-0002
Column 2 FIRSTNAME : Leverling
Column 3 LASTNAME : NULL
Column 4 TITLE : Vice President-New Products
Column 5 COMPANYNAME : Northwind Traders
Column 6 ADDRESS : 722 Moss Bay Blvd.
Column 7 CITY : Kirkland Column 8 STATEORPROVINCE : WA
Column 9 POSTALCODE : 98033
Column 10 COUNTRY : USA
Column 11 PHONENUMBER : (206) 555-3412
Column 12 FAXNUMBER : (206) 555-3413
Column 13 EMAILADDR : jleverling@northwind.com
Column 14 MEMBERSINCE : 1999-07-09 22:03:03
Failed to insert a row (rc = -9).
4 rows inserted.
2 rows updated.
1 rows were rejected.
Database load complete.
Warning returned to engine: (1) One or more records could not be processed
Cleaning up and closing the transaction...
The transaction was successfully committed.
Status returned to engine: (0)
SuccessCommit was successful.
Database disconnect succeeded.All of the information in this trace file example is the same as the previous example except for the bold lines of text. In this example, because -BADDATA was used, the database adapter goes on to process all of the other rows produced for the target. Upon completion, four rows were successfully inserted, two rows were successfully updated, and one row was rejected. The rejected record was saved in the file specified with the Bad Data adapter command (-BADDATA). In this example, the rejected record was saved to a file called badstuff.txt.
The remaining lines in the database trace file indicate information about the disposition of the entire database card transaction. Notice that the use of -BADDATA allows the card to successfully complete. The map successfully completes and the transaction is committed.
If you produced the audit log, you would see the following line in the execution summary section:
<TargetReport card="1" adapter="DB" bytes="1218" adapterreturn="1">
<Message>One or more records could not be processed</Message>
<TimeStamp>22:07:32 January 8, 2004</TimeStamp>
</TargetReport>