IMPORTANT:
this is not a Support Forum! Experienced users might answer from time to time questions posted here. If you need a professional and reliable answer, or if you want to report a bug, please contact Altova Support instead.

EDI-> DB- can loop repeated EDI segment & map to different fields in DB Options · View
Antonio92
Posted: Tuesday, March 25, 2014 12:06:51 PM
Rank: Member

Joined: 3/25/2014
Posts: 23
Location: Spain
I need to concatenate something like repeating FTX segment from EDI to DB, as below:

EDI:
FTX+HAN++Text1'
FTX+HAN++Text2'
FTX+HAN++Text3'

Each table in DB has (along with others) 3 rows in which I want to put Text1, Text2 and Text3 respectively.

I tried the string-join function but it produces flat output delimited by a character. What can I use to do what I am trying to do?

Thanks
ultrabeet
Posted: Tuesday, March 25, 2014 3:13:59 PM
Rank: Advanced Member

Joined: 8/19/2012
Posts: 149
Location: Ireland
Antonio92,

This does not sound like a string join.

If you want 3 rows for 3 FTX segments, just connect the FTX straight to the table.
Antonio92
Posted: Tuesday, March 25, 2014 4:19:51 PM
Rank: Member

Joined: 3/25/2014
Posts: 23
Location: Spain
ultrabeet wrote:
Antonio92,

This does not sound like a string join.

If you want 3 rows for 3 FTX segments, just connect the FTX straight to the table.


The FTX thing was an example. In fact, I am trying to do it with a three LOC segments.

I cannot directly connect the LOC segments to the DB because only the first segment show up in MapForce. It is 3 times repeated (no "maxOccurs" in config file) but I do not know how to select each one and map them to each row respectively.

Thank you
ultrabeet
Posted: Tuesday, March 25, 2014 4:59:46 PM
Rank: Advanced Member

Joined: 8/19/2012
Posts: 149
Location: Ireland
Antonio92,

As you are going for a quick and dirty solution, you can create 3 targets of the same table and connect each of them to your copies of LOC
Antonio92
Posted: Tuesday, March 25, 2014 6:54:23 PM
Rank: Member

Joined: 3/25/2014
Posts: 23
Location: Spain
ultrabeet wrote:
Antonio92,

As you are going for a quick and dirty solution, you can create 3 targets of the same table and connect each of them to your copies of LOC

I think I did not explain well.

The solution you provide will create 3 different rows. The three copies of LOC must go to the SAME row in database. E.g. one copy means "port of origin", other one means "destination port" and other one is an additional port. Theese three things must be in the same row in the table.
ultrabeet
Posted: Wednesday, March 26, 2014 9:21:56 AM
Rank: Advanced Member

Joined: 8/19/2012
Posts: 149
Location: Ireland
Antonio92,

Then you need to create an intermediate structure eg. XSD or CSV between the EDI and the database.

Your 3xLOC will populate all elements of the intermediate object, whereas the row of the object itself will populate the database with 3 different columns, but will only create 1 row.

I hope it makes sense to you.
Antonio92
Posted: Thursday, March 27, 2014 8:53:37 PM
Rank: Member

Joined: 3/25/2014
Posts: 23
Location: Spain
ultrabeet wrote:
Antonio92,

Then you need to create an intermediate structure eg. XSD or CSV between the EDI and the database.

Your 3xLOC will populate all elements of the intermediate object, whereas the row of the object itself will populate the database with 3 different columns, but will only create 1 row.

I hope it makes sense to you.


Could you explain how to do this? I can't figure it out.

Thank you
ultrabeet
Posted: Friday, March 28, 2014 9:42:42 AM
Rank: Advanced Member

Joined: 8/19/2012
Posts: 149
Location: Ireland
Sorry Antonio92,

I got confused there myself.
This is an output behaviour, rather than input.

How do you manage to get multiple the LOC if the schema does not have maxOccurs for it?

I think your only option is to alter the message spec and then once you can loop on LOC, do something similar to the screenshot


ultrabeet attached the following image(s):
capture.png

Antonio92
Posted: Saturday, March 29, 2014 12:03:44 AM
Rank: Member

Joined: 3/25/2014
Posts: 23
Location: Spain
That was exactly what I was looking for. Thank you!
Antonio92
Posted: Wednesday, April 2, 2014 3:45:08 PM
Rank: Member

Joined: 3/25/2014
Posts: 23
Location: Spain
One more question: How could I do the inverse?

I have the data for the three segments in database, and I want to generate three LOC segments in an output EDI. First one with one value, second one with the second one and the third with the third one.
that
Posted: Wednesday, April 2, 2014 4:55:02 PM
Rank: Advanced Member

Joined: 6/16/2006
Posts: 487
Location: AT
Antonio92 wrote:
One more question: How could I do the inverse?


Use "Duplicate Input".
Users browsing this topic
guest

Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Use of the Altova User Forum(s) is governed by the Altova Terms of Use.