Tuesday, December 11, 2012

Sending records to target tables in cyclic order

There is a source table and 3 destination table T1,T2, T3. How to insert first 1 to 10 record in T1, records from 11 to 20 in T2 and 21 to 30 in T3.Then again from 31 to 40 into T1, 41 to 50 in T2 and 51 to 60 in T3 and so on i.e in cyclic order.


Solution:
1. Drag the source and connect to an expression.Connect the next value port of sequence generator to expression.


2. Send the all ports to a router and make three groups as bellow
Group1
mod(NEXTVAL,30) >= 1 and mod(NEXTVAL,30) <= 10 Group2 mod(NEXTVAL,30) >= 11 and mod(NEXTVAL,30) <= 20 Group3 mod(NEXTVAL,30) >= 21and mod(NEXTVAL,30) <= 29 or mod(NEXTVAL,30) = 0



3. Finally connect Group1 to T1, Group2 to T2 and Group3 to T3.



3 comments:


  1. This technical post helps me to improve my skills set, thanks for this wonder article I expect your upcoming blog, so keep sharing..
    Regards,
    Best Informatica Training In Chennai|Informatica training in chennai

    ReplyDelete
  2. please let me know what about the logic next 31 to 40 records should be loaded into 1st target .

    ReplyDelete

Thank you :
- kareem