Вы находитесь на странице: 1из 7

The high level view of this document is to give some knowledge on how to use mapping variables and work

flow variables. Assume you have source CUST and you need to read data from CUST based on CUST_ID. We need to assign max CUST_ID from CUST table to sql override dynamically using mapping variables and work flow variable. Create mapping m_Mapping_Variable_1 with source as CUST It contains CUST_ID 80001, 80002 and 8003

In this mapping create variable $$MAX_ID

In source qualifier override the query to get max(CUST_ID) from source.

In expression using set variable function set value coming from source to mapping variable.

In filter use FALSE condition so no record will load in to target.

Create another mapping m_Mapping_Variable_2

In this mapping create mapping variable $$MAX_ID

In source qualifier use sql override to pull data from source based on CUST_ID.

So, in first mapping will pull max CUST_ID id from CUST table and assigning that value to mapping variable. In second mapping use $$MAX_ID in sql override to pull data greater than max value in source Create two sessions s_Mapping_Variable_1 and s_Mapping_Variable_2 for two mappings. For these two sessions create one work flow wkfl_Mapping_Variable.

Create one work flow variable $$CUST_ID in work flow variable tab.

In first session -- >components tab we have post session on success variable assignment option.

In session on success variable assignment I assigned first mapping variable value to work flow variable

In second -- >components tab we have pre session variable assignment option.

Using this option I assigned work flow variable value to second mapping variable.

Now I ran the work flow.

Two sessions are succeeded. In first session sessionlog showing max value from source assigned to work flow variable.

In second session log work flow variable value assigned to mapping variable successfully

And same value used in sql override.

Вам также может понравиться