You are on page 1of 2

he Integration Service looks for the value in the following order:

1.Value in parameter file


2.Value in pre-session variable assignment
3.Initial value saved in the repository
4.Datatype default value
Mapping Variables
Mapping variable represents a value that can change through the session. The In
tegration Service saves the value of a mapping variable to the repository at the
end of each successful session run and uses that value the next time you run th
e session
Variable Values
The Integration Service holds two different values for a mapping variable durin
g a session run:
1. Start value of a mapping variable
2. Current value of a mapping variable
The Integration Service looks for the start value in the following order:
1. Value in parameter file
2. Value in pre-session variable assignment
3. Value saved in the repository
4. Initial value
5. Datatype default value
Variable Functions
Variable functions determine how the Integration Service calculates the current
value of a mapping variable in a pipeline.
1.SetMaxVariable. Sets the variable to the maximum value of a group of values.
It ignores rows marked for update, delete, or
reject.To use the SetMaxVariable with a mapping variable, the aggregation typ
e of the mapping variable must be set to Max.
2. SetMinVariable. Sets the variable to the minimum value of a group of values.
It ignores rows marked for update, delete, or
reject. To use the SetMinVariable with a mapping variable, the aggregation t
ype of the mapping variable must be set to Min.
3. SetCountVariable. Increments the variable value by one. In other words, it a
dds one to the variable value when a row is marked
for insertion, and subtracts one when the row is marked for deletion. It ign
ores rows marked for update or reject. To use the SetCountVariable with a mappin
g variable, the aggregation type of the mapping variable must be set to Count.
4. SetVariable. Sets the variable to the configured value. At the end of a sess
ion, it compares the final current value of the
variable to the start value of the variable. Based on the aggregate type of
the variable, it saves a final value to the repository. To use the SetVariable f
unction with a mapping variable, the aggregation type of the mapping variable mu
st be set to Max or Min. The SetVariable function ignores rows marked for delete
or reject.
The
able
1)
2)
3)
4)

Integration Service does not save the final current value of a mapping vari
to the repository when any of the following conditions are true:
The session fails to complete.
The session is configured for a test load.
The session is a debug session.
The session runs in debug mode and is configured to discard session output.

IsExprVar
Determines how the Integration Service expands the variable in an expression str
ing. If true, the Integration Service expands the variable before parsing the ex
pression. If false, the Integration Service expands the variable after parsing t

he expression. Default is false.


Note: If you set this field to true, you must set the variable datatype to Strin
g, or the Integration Service fails the session.
Override or Clear Saved Values
After a session completes successfully, the Integration Service saves the final
value of each variable in the repository. When you do not want to use that valu
e the next time you run the session, you can override the value in the parameter
file or the pre-session variable assignment in the session properties.
When you do not want to use any of the variable values saved for a session, you
can clear all saved values. You can clear variable values for a session using t
he Workflow Manager. After you clear variables values from the repository, the I
ntegration Service runs the session as if for the first time.
Guideline
1. Enclose string and datetime parameters and variables in quotes in the SQL Ed
itor. as STATE = $$State
2. When you use a datetime parameter or variable in the Source Qualifier transf
ormation, you might need to change the date
format to the format used in the source.
3. Code page compatibility while defining parameter or variable and providing v
alue in parameter file.

You might also like