Guidelines for configuring the target update override
Guidelines for configuring the target update override
Use the following guidelines when you enter target update queries:
If you use target update override, you must manually put all database reserved words in quotes.
You cannot override the default UPDATE statement if a target column name contains any of the following characters:
' , ( ) < > = + - * / \ t \ n \ 0 <space>
If you update an individual row in the target table more than once, the database only has data from the last update. If the mapping does not define an order for the result data, different runs of the mapping on identical input data may result in different data in the target table.
A WHERE clause that does not contain any column references updates all rows in the target table, or no rows in the target table, depending on the WHERE clause and the data from the mapping. For example, the following query sets the EMP_NAME to "MIKE SMITH" for all rows in the target table if any row of the transformation has EMP_ID > 100:
UPDATE T_SALES SET EMP_NAME = 'MIKE SMITH' WHERE :TU.EMP_ID > 100
If the WHERE clause contains no field references, the mapping updates the same set of rows for each row of the mapping. For example, the following query updates all employees with EMP_ID > 100 to have the EMP_NAME from the last row in the mapping:
UPDATE T_SALES SET EMP_NAME = :TU.EMP_NAME WHERE EMP_ID > 100
If you set the target operation to update or upsert, configure the
mapping
task to treat source rows as update in the advanced session properties.