When you want to use the same value for a mapping parameter each time yourun the session, use the same parameter file for each session run. When youwant to change the value of a mapping parameter between sessions you canperform one of the following tasks:Update the parameter file between sessions.Create a different parameter file and configure the session to use the new file.Remove the parameter file from the session properties. The Integration Serviceuses the parameter value in the pre-session variable assignment. If there is nopre-session variable assignment, the Integration Service uses the configuredinitial value of the parameter in the mapping.
Unlike a mapping parameter, a mapping variable represents a value that canchange through the session. The Integration Service saves the value of amapping variable to the repository at the end of each successful session run anduses that value the next time you run the session.When you use a mapping variable, you declare the variable in the mapping or mapplet, and then use a variable function in the mapping to change the value of the variable. At the beginning of a session, the Integration Service evaluatesreferences to a variable to determine the start value. At the end of a successfulsession, the Integration Service saves the final value of the variable to therepository. The next time you run the session, the Integration Service evaluatesreferences to the variable to the saved value. To override the saved value, definethe start value of the variable in a parameter file or assign a value in the pre-session variable assignment in the session properties.Use mapping variables to perform incremental reads of a source. For example,the customer accounts in the mapping parameter example above are numberedfrom 001 to 065, incremented by one. Instead of creating a mapping parameter,you can create a mapping variable with an initial value of 001. In the mapping,use a variable function to increase the variable value by one. The first time theIntegration Service runs the session, it extracts the records for customer account001. At the end of the session, it increments the variable by one and saves thatvalue to the repository. The next time the Integration Service runs the session, itextracts the data for the next customer account, 002. It also increments thevariable value so the next session extracts and looks up data for customer account 003.
Parameters and Variables
You can use parameters and variables in the SQL query, user-defined join,source filter, and pre- and post-session SQL commands of a Source Qualifier transformation. Use any parameter or variable type that you can define in theparameter file. You can enter a parameter or variable within the SQL statement,or you can use a parameter or variable as the SQL query. For example, you canuse a session parameter, $ParamMyQuery, as the SQL query, and set$ParamMyQuery to the SQL statement in a parameter file.The Integration Service first generates an SQL query and expands eachparameter or variable. It replaces each mapping parameter, mapping variable,and workflow variable with its start value. Then it runs the query on the sourcedatabase.