We use mapping Variales for current session run to store and manipulate expression. We will See intelligent use of mapping variables. Mapping variables are very simple to create.
In mapping designer,
Goto Mapping Menu
Select Parameters and Variables option. create date type variable $$URF_CA_FROM.
Initialized with '04/05/2009' (any valid date value for first run).
Use this variable in any transformation column.
Use function SETVARIABLE($$URF_CA_FROM,SYSDATE) to store current date.
Link it with some other transformation coulmn of same datatype(date).
Now, When we run this mapping, variable will store current session system date value and persist in repository. At Next run time, We can utilize this value in soure qualifier in where condition.
We can use any datatype of variable to store prev run value and use this value in next execution.
i.e.
If session run on 02/06/2009, $$x variable stores this value.
now, we are running session on 12/06/2009, we can retrieve value of $$x in any transformation in same mapping. We can see this variable'spersist value in workflow manager.
right click on session at workflow level. select View persistent Values option to see and reset values.
***This logic will eliminate lot of DB dependencies and make incremental logic easy.
Limitations:
- Variable must be initialized
- We need to link SETVARIABLE() function column to same datatype column.
- It should executed at least once for insert/update/delete.
No comments:
Post a Comment