An in-out parameter is a placeholder for a value that stores a counter or task stage.
Data Integration
evaluates the parameter at run time based on your configuration.
In-out parameters act as persistent task variables. The parameter values are updated during task execution. The parameter might store a date value for the last record loaded from a data warehouse or help you manage the update process for a slowly changing dimension table.
For example, you might use an in-out parameter in one of the following ways:
Update values after each task execution.
You can use the SetVariable, SetMaxVariable, SetMinVariable, or SetCountVariable function in an Expression transformation to update parameter values each time you run a task.
To view the parameter values after the task completes, open the job details from the
All Jobs
or
My Jobs
page. You can also get these values when you work in the Mapping Designer
or through the REST API
.
Handle incremental data loading for a data warehouse.
In this case, you set a filter condition to select records from the source that meet the load criteria. When the task runs, you include an expression to increment the load process. You might choose to define the load process based on one of the following criteria:
A range of records configured in an expression to capture the maximum value of the record ID to process in a session.
A time interval, using parameters in an expression to capture the maximum date/time values, after which the session ends. You might want to evaluate and load transactions daily.
Parameterize an expression.
You might want to parameterize an expression and update it when the task runs. Create a string or text parameter and enable
Is expression variable
. Use the parameter in place of an expression and resolve the parameter at run time in a parameter file.
For example, you create the expression field parameter $$param and override the parameter value with the following values in a parameter file:
$$param=CONCAT(NAME,$$year)
$$year=2020
When the task runs,
Data Integration
concatenates the NAME field with 2020.
Parameterize a user-defined function.
Use an in-out parameter to parameterize all or part of a user-defined function in an expression.
Create a string parameter and enable
Is expression variable
. In the expression, you can use the in-out parameter as a placeholder for the user-defined function or for an argument in the user-defined function. Resolve the parameter at runtime in the
mapping
task or in the parameter file.
Using in-out parameters in simultaneous
mapping
task runs can cause unexpected results.
You can use in-out parameters in the following transformations:
Source
Target
Aggregator, but not in expression macros
Expression, but not in expression macros
Filter
Router
SQL
Transaction Control
For each in-out parameter you configure the variable name, data type, default value, aggregation type, and retention policy. You can also use a parameter file that contains the value to be applied at run time. For a specific task run, you can change the value in the
mapping
task.
Unlike input parameters, an in-out parameter can change each time a task runs. The latest value of the parameter is displayed in the job details when the task completes successfully. The next time the task runs, the
mapping
task compares the in-out parameter to the saved value. You can also reset the in-out parameters in a
mapping
task, and then view the saved values in the job details.
In advanced mode, string and text in-out parameter values don't change each time the task runs. The
mapping
task always uses the same parameter value.
You can't use in-out parameters in mappings in SQL ELT mode.