Tuesday, June 1, 2010

Informatica Database Error

Error Message: SQL Server Message: INSERT statement conflicted with COLUMN FOREIGN KEY constraint 'XXX'. The conflict occurred in database 'YYY', table 'ZZZ', column 'AAA'.

Issue Description: When running a session in informatica, the session succeeded, but there were target failed rows.  Upon inspection of the session log file, the following database error was noted: SQL Server Message: INSERT statement conflicted with COLUMN FOREIGN KEY constraint 'XXX'. The conflict occurred in database 'YYY', table 'ZZZ', column 'AAA'.

Issue Resolution: The informatica mapping was correct.  The problem was that there were parent-child tables that were being populated and child records were being populated before the parent records.  Due to this, at database level, since the parent record did not exist at the time the child was being populated, the record was rejected to maintain the database integrity.  To solve this:
(1) You can enable constraint based loading for that session.  For this, the parent-child relationships need to be defined at informatica level as well, in the warehouse designer.
(2) Modify the target load plan in designer.
(3) Remove the foreign key constraint at database level if you are sure that the data being populated by informatica will not corrupt the database integrity.  However, this solution is not recommended.

No comments:

Post a Comment