When you use parameters in a mapping, you can change the parameter values each time you run the
mapping
task. You specify the parameter values in the
mapping
task or in a parameter file.
Use the following guidelines when you use parameters in a mapping:
When you create a mapping that includes source parameters, add the parameters after you configure the mapping.
For example, you have multiple customer account tables in different databases, and you want to run a monthly report to see customers for a specific state. When you create the mapping, you want to use parameters for the source connection, source object, and state. You update the parameter values to use at runtime when you configure the task.
To configure the mapping, you perform the following steps:
In the mapping, select the Source transformation.
On the
Source
tab, select a connection that contains one of the objects that you want to use, and then select the source object.
You replace the source connection and object with parameters after the mapping is configured. You cannot select a source object if the source connection is a parameter. Add a source object so that you can configure the downstream data.
Add a Filter transformation.
On the
Filter
tab, add a filter condition. Select State for the field name, and create a new string parameter for the value. You resolve the parameter when you configure the task.
Configure the Target transformation.
Select the Source transformation.
On the
Source
tab, replace the source connection and the source object with parameters.
When you create a mapping with a parameterized target that you want to create at runtime, set the target field mapping to automatic.
If you create a mapping with a parameterized target object and you want to create the target at runtime, you must set the target field mapping to
Automatic
on the Target transformation
Field Mapping
tab. Automatic field mapping automatically links fields with the same name. You cannot map fields manually when you parameterize a target object.
Use caution when you use the same input parameter across transformations in
mappings in
advanced
mode and
SQL ELT mode.
When you use the same input parameter in multiple transformations in a
mapping in
advanced mode or
SQL
ELT mode, you might encounter unexpected behavior in the mapping task.
For example, a mapping contains an Expression transformation followed by an
Aggregator transformation, and the expressions in both transformations use
the same expression parameter. When you configure the parameter in the
mapping task, the
Built-in functions
list does not
display aggregate functions since the Aggregator transformation is
downstream of the Expression transformation. To avoid this type of
unexpected behavior, in mappings in
advanced mode and
SQL ELT mode, use different input parameters in
each transformation.