Saturday, December 24, 2011

Target Update Override in Informatica


                                      By default, the Informatica Server updates targets based on key values. However, you can override the default UPDATE statement for each target in a mapping. You might want to update the target based on non-key columns.
                                    For a mapping without an Update Strategy transformation, configure the session to mark source records as update. If your mapping includes an Update Strategy transformation, the Target Update option only affects source records marked as update. The Informatica Server processes all records marked as insert, delete, or reject normally. When you configure the session, mark source records as data-driven. The Target Update Override only affects source rows marked as update by the Update Strategy transformation.
Overriding the WHERE Clause
 Default:              UPDATE T_EMP_UPDATE_OVERRIDE SET ENAME = :TU.ENAME, JOB = :TU.JOB, SAL = :TU.SAL WHERE ENAME = :TU.ENAME
                        You can override the WHERE clause to include non-key columns. For example, you might want to update records for employees named Smith only. To do this, you edit the WHERE clause as follows:
UPDATE T_EMP_UPDATE_OVERRIDE SET EMPNO = :TU.EMPNO, ENAME = :TU.ENAME, JOB = :TU.JOB, SAL = :TU.SAL  where  ENAME = :TU.ENAME AND ENAME='SMITH'
                       Entering a Target Update Statement
            Follow these instructions to create an update statement.
To enter a target update statement:
1. Double-click the title bar of a target instance.
2. Click Properties.
4. Click the arrow button in the Update Override field.
5. The SQL Editor displays.
5. Select Generate SQL.
The default UPDATE statement appears.
6. Modify the update statement.
You can override the WHERE clause to include non-key columns.
7. Click OK.
NOTES:
1. One more thing i want to say that is :TU is a reserved keyword in Informatica to be used to match target port names with target table's column name.
2.The general error when we are doing this is as follows
"TE_7023 Transformation Parse Fatal Error; transformation stopped... error constructing sql statement".
        Check the following to Solve This..
1. Override Statement Once
2. You have to keep a space before the :TU.

  

No comments:

Post a Comment