You can also use a dynamic file name in a mapping that contains a Transaction Control transformation to write data to a different target file each time a transaction boundary changes. For example, the following expression can be used in a target that is downstream of the Transaction Control transformation to commit data to a different target file every time the DEPT_ID field changes:
'Results_Dept_'||To_Char(DEPT_ID)||'.dat'
To specify a dynamic file name, in the
Target Object
dialog box, select
Use a Dynamic File Name
and enter the file name expression in the expression editor.
The following image shows the
Target Object
dialog box with the
Use a Dynamic File Name
option enabled:
You can include incoming field names, constants, operators, built-in functions, and user-defined functions in the target file name expression.
If you use an incoming field name in the file name expression, you can choose to exclude the field from the target. When you enable the
Exclude Dynamic File Name Field
option,
Data Integration
does not write the incoming field used in the expression to the target. Include only one incoming field in the expression. If you include more than one incoming field, the expression is invalid.
To use more than one incoming field, add an Expression transformation directly before the Target transformation. In the Expression transformation, configure a field to hold the expression that you want to use as the file name. In the Target transformation, use this field as the expression in the dynamic file name.
For more information about creating expressions, see the