To allow users to select one of the fields based on an input parameter at run time, you can implement partial parameterization in a mapping. Use partial parameterization to create templates for incremental data loads and other solutions.
For example, if you completely parameterize the source filter, you must include a query similar to the following example:
lastmodified_date > $$myvar
To partially parameterize the filter, you can specify the field as a variable, as shown in this example:
$field$ > $$myvar
In this case, the user can select the required field in the
mapping
task.
To implement partial parameterization, you must use a database connection and a Source transformation advanced filter or a Filter, Expression, Router, or Aggregator transformation. You can create an input parameter for one of the fields so that the user can select a specific field in the
mapping
task instead of writing a complete query. "String" and "field" are the only valid types.
You can use the same parameter in all the supported transformations.
In the following example, the filter condition uses a parameter for the field name:
Rules and guidelines for partial parameterization
When you configure partial parameterization, note the following rules and guidelines:
If you define a field type parameter in a Source transformation advanced filter, you can reuse it in a downstream transformation like a Router, Filter, Expression, or Aggregator. You cannot directly use field type parameters in other transformations.
To distinguish parameters used for partial parameterization from in-out parameters (
$$myVar
), represent the parameter like an expression macro, for example,
$<Parameter_Name>$
.
If you use a field type parameter in a Source transformation with multiple objects, qualify the parameter with the object name. You can either use the object name in the mapping or use a string type parameter to configure it in a
mapping
task.
You cannot pass values for partial parameterization through a parameter file.
You cannot use a user-defined function in an expression that uses partial parameterization. For example, the following expression is not valid: