How to create a condition inside a flow to execute or not a mapping
569536Mar 21 2011 — edited Mar 23 2011Hi everybody, I'm quite new on OWB and I don't know how to build a flow to do the following things:
Scenario
1. the flow (three mappings in series) has to run every day, but ONLY the first two has to run every day, while the third (used for the fact partitioning) has to run ONLY on the last day of the month (practically 12 times a year), to capture the last fact's image and put all the data inside a backup table.
So, only when the flow runs on the last day of each month, the third mapping is executed. If we are not at the end of the month, the third mapping has to be bypassed and the flow has to stop.
To do this, I need a condition that compares two values
a) select RUN_DATE
from DW_CONTROL_TABLE
where PROCEDURE_NAME = 'OTE_DW_LAST_RUN' --> that retrieve the date when the flow runs (every day I have the current sysdate)
b) select TRUNC(LAST_DAY(sysdate)) from dual --> that retrieve the last day of each month
ONLY when these two dates are the same, the third mapping has to run
I tried to use the WHILE_LOOP activity, combined with the ASSIGN but It doesn't work properly......
How can I achieve this result ?? Which activities I need to create this flow ?
I repeat..I'm a very beginner, so if somebody can give some hint or example, I'll appreciate it very much.
Thanks in advance
Alessandro