Académique Documents
Professionnel Documents
Culture Documents
My source is a flat file which contains N number of records. I want to load the
source data into two targets such that first five records should loaded into the
first target, next five records into the second target table. Again the next source
five records into the first target table and so on. How to implement a Informatica
mapping logic for this?
Solution:
DECODE(substr(o_cnt,-1,1),1,TRUE,2,TRUE,3,TRUE,4,TRUE,5,TRUE,FALSE)
DECODE(substr(o_cnt,-1,1),6,TRUE,7,TRUE,8,TRUE,9,TRUE,0,TRUE,FALSE)
Connect the router transformation output groups to the appropriate
targets.
Solution:
Create a mapping to find out the number of records in the source and write
the count to a parameter file. Let call this parameter as $$SOURCE_COUNT.
Create another mapping. Go to the mapping parameters and variables,
create a mapping variable ($$VAR_SESSION_RUNS) with integer data type.
Connect the source qualifier transformation to the expression
transformation. In the expression transformation, create the below additional
ports.
setvariable($$vAR_SESSION_RUNS,1),
IIF( !ISNULL($$vAR_SESSION_RUNS)
and v_Count=1,
2,
$$vAR_SESSION_RUNS)