Table of Contents

Search

  1. Preface
  2. Transformations
  3. Source transformation
  4. Target transformation
  5. Aggregator transformation
  6. Cleanse transformation
  7. Data Masking transformation
  8. Data Services transformation
  9. Deduplicate transformation
  10. Expression transformation
  11. Filter transformation
  12. Hierarchy Builder transformation
  13. Hierarchy Parser transformation
  14. Hierarchy Processor transformation
  15. Input transformation
  16. Java transformation
  17. Java transformation API reference
  18. Joiner transformation
  19. Labeler transformation
  20. Lookup transformation
  21. Machine Learning transformation
  22. Mapplet transformation
  23. Normalizer transformation
  24. Output transformation
  25. Parse transformation
  26. Python transformation
  27. Rank transformation
  28. Router transformation
  29. Rule Specification transformation
  30. Sequence Generator transformation
  31. Sorter transformation
  32. SQL transformation
  33. Structure Parser transformation
  34. Transaction Control transformation
  35. Union transformation
  36. Velocity transformation
  37. Verifier transformation
  38. Web Services transformation

Transformations

Transformations

Flat file targets with dynamic file names

Flat file targets with dynamic file names

If you create a flat file target at run time, you can specify a dynamic file name. A dynamic file name uses an expression to generate the file name.
You can use a dynamic file name to create a new target file every time the
mapping
task runs. For example, the following expression creates a file called "OrdersOut_<system_timestamp_with_second_precision>.csv" each time the
mapping
task runs:
'OrdersOut_'||To_Char(SYSDATE, 'YYYYMMDDHH24MISS')||'.csv'
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:
The image shows the Target Object dialog box for a flat file target. The "Create New at Runtime" option is selected and the "Use a Dynamic File Name" check box is checked. Because a dynamic file name is selected, the expression editor appears in the dialog box. The expression 'Results_Dept_'||To_Char(DEPT_ID)||'.dat' is entered in the expression editor.
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
Function Reference
.

0 COMMENTS

We’d like to hear from you!