I have a mapping problem. I simply don’t know how to do it. Maybe you could help out or point me to a good article that teaches how to use the mapper.
I have two messages, one message is from a flatfile (MessageA) and another message is from a database (MessageB). Now, MessageA has two columns (Code1 and Code2). MessageB has (ID, CodeIndex). I want to join these two messages into one and insert into a database table. The target table is (ID, Code). So depending on CodeIndex from MessageB, I either join Code1 or Code2. Here’s sample data.
Message A
———–
Code1, Code2
111, 222
333, 444
Message B
———–
ID, CodeIndex
1, ’03’
2, ’04’
3, ’03’
4, ’04’
What I want to insert into database
the rule is, if CodeIndex=’03’ then use Code1
if codeIndex=’04’ then use code2
———————————–
ID, Code
1, 111
1, 333
2, 222
2, 444
3, 111
3, 333
4, 222
4, 444
I am sure it’s not that hard with the mapper, I just don’t know enough about it and I haven’t come upon articles that explain it in depth.
Thanks