The transaction commit control lets you control commit and roll back transactions based on a set of rows that pass through the transformation.
Enter an IIF function to specify the conditions to determine whether the
mapping
task commits, rolls back, or makes no transaction changes to the row. When the
mapping
task issues a commit or roll back based on the return value of the expression, it begins a new transaction.
You cannot configure a transaction commit control if you are connecting to multiple source objects.
Use the following syntax for the expression:
IIF (condition, value1, value2)
Use the following built-in variables when you create a transaction control expression:
TC_CONTINUE_TRANSACTION. The
mapping
task does not perform any transaction change for this row. This is the default value of the expression.
TC_COMMIT_BEFORE. The
mapping
task commits the transaction, begins a new transaction, and writes the current row to the target. The current row is in the new transaction.
TC_COMMIT_AFTER. The
mapping
task writes the current row to the target, commits the transaction, and begins a new transaction. The current row is in the committed transaction.
TC_ROLLBACK_BEFORE. The
mapping
task rolls back the current transaction, begins a new transaction, and writes the current row to the target. The current row is in the new transaction.
TC_ROLLBACK_AFTER. The
mapping
task writes the current row to the target, rolls back the transaction, and begins a new transaction. The current row is in the rolled back transaction.
If the transaction control expression evaluates to a value other than commit, roll back, or continue, the mapping is invalid.
Example
You want to use transaction commit control to write order information based on the order entry date. You want all orders entered on a given date to be committed to the target in the same transaction.
You create a field named New_Date and populate it by comparing the order date of the current row to the order date of the previous row. If the orders have different dates, then New_Date evaluates to 1.
You then use the following expression to commit data when the