on 01-20-2011 4:24 AM
Hi,
I am doing a jdbc to flat file,
I have the below input structure
<row>
<order>
<customerno>
<id>
<sid>
<qty>
<price>
</row>
I need the output file as below
order#customerno#id
sid#qty#price
sid#qty#price
sid#qty#price
order#customerno#id
sid#qty#price
sid#qty#price
order#customerno#id
sid#qty#price
sid#qty#price
order#customerno#id are header fields which occur once and sid#qty#price are details which repeat
how should I desing my output structure and map them,what node functions do I need to use?I am fine doing FCC once the mapping is done
Thanks
Hi,
order#customerno#id
sid#qty#price
sid#qty#price
sid#qty#price
order#customerno#id
sid#qty#price
sid#qty#price
order#customerno#id
sid#qty#price
sid#qty#price
Target_MT
-->Header(0..unbounded)
-
>Order
-
>Customer
-
>ID
-->Records(0..unbounded)
-
>sid
-
>qty
-
>price
Now in FCC put Recordset as Header,,Records,
Field Seperator as #
Header and Records have 0..unbounded and are at same level.
Babu
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks for the reply, please see the source example below, if the header fields are same then only the detail has to come and header should not repeat, do I need to write any udf for this?
<row>
<order1>
<customerno1>
<id1>
<sid1>
<qty1>
<price1>
</row>
<row>
<order1>
<customerno1>
<id1>
<sid2>
<qty2>
<price2>
</row>
<row>
<order2>
<customerno2>
<id2>
<sid3>
<qty3>
<price3>
</row>
<row>
<order2>
<customerno2>
<id2>
<sid4>
<qty4>
<price4>
</row>
output file
order1#customerno1#id1
sid1#qty1#price1
sid2#qty2#price2
order2#customerno2#id2
sid3#qty3#price3
sid4#qty4#price4
Hi,
Ok now, we have a header and Records for every order.
You want to remove the all the Header elements from target payload for which you have same combination.
Use one more Message Mapping in the same Interface Mapping, which will remove these header nodes which are repeating.
This second mapping will be executed after the first mapping in sequence.
Let us know if still you face the problem...
Babu
User | Count |
---|---|
85 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.