Page 1 of 1

functional map runs only once

Posted: Fri Apr 21, 2006 2:42 pm
by jackcool
I have a functional map which should be creating one output record for each occurance of input record.According to the map designer interface guide ,we just need to pass the input type that occures multiple times as argument to functional map and rest will be taken care by Tx.

Structure of my input file is
Line1 -- Occurres once
Line2 -- Occurres multiple times

something like Order + Line Item scenario.

I created types as
Order(1)
LineItemDetails(S)

I created a functional map which takes LineItemDetails as arguement.As per the documentation functional map should be called for each occurrence of Line Item ,but i dont see that happening.I see only once the functional map is called and one row is created in Database.

Am i missing something ?

Posted: Fri Apr 21, 2006 2:56 pm
by jgibby
Is the output card where you are calling the functional map a series object as well? It has to be for the functional map to be called multiple times.

John

Posted: Fri Apr 21, 2006 3:05 pm
by jackcool
Iam not sure about whether my OutputCard is series or not ?

when you a series object do you mean multiple occurrances ?

Since my target is Database my output card is referring to a type called

LineItemDetails --->which has Row LINEITEM (S) where LINEITEM is my table name.

LineItemDetails ---> Row LINEITEM (s)
---> LINEITEM_ID
---> ITEM_NAME
---> ITEM_DESCRIPTION

Posted: Mon Apr 24, 2006 7:41 am
by jgibby
Yes, by "series object" I do mean an item that can occur more than once.

So I am guessing you have something like this:

Code: Select all

InputCard
InputItems (s)
Going into:

Code: Select all

LineItemDetails
LINEITEMS (s)
---> LINEITEM_ID
---> ITEM_NAME
---> ITEM_DESCRIPTION
For this you would need to call your functional map from the LINEITEMS field in a manner something like this:

Code: Select all

=F_Build_LineItem(InputItems)
To iterate your series objects to correctly call a functional map, you need to use your input series object on an output card's series object.

I hope this helps,
John

Posted: Mon Apr 24, 2006 8:24 am
by janhess
What do you plan to do with the table name in LINEITEM?

Posted: Mon Apr 24, 2006 8:29 am
by janhess
What do you plan to do with the table name in LINEITEM?

Posted: Mon Apr 24, 2006 4:21 pm
by jackcool
janhess wrote:What do you plan to do with the table name in LINEITEM?
When i generated the type tree from DB Interface Designer thats how it was generated.It created tree as

Data --> TableName--Column
Row
DBTable

Posted: Mon Apr 24, 2006 4:34 pm
by jackcool
jgibby wrote: To iterate your series objects to correctly call a functional map, you need to use your input series object on an output card's series object.

I hope this helps,
John
I generated a type DBTable --> which has Row(s)
e.g.,
LINTEITEM-->DBTable --->Row(s) --->Column names

My Output card is mapped to DBTable,will this be considered a series object ?

Otherwise i have to figure out a way to make DBTable a series object.

Posted: Mon Apr 24, 2006 6:40 pm
by jgibby
jackcool wrote:
jgibby wrote: To iterate your series objects to correctly call a functional map, you need to use your input series object on an output card's series object.

I hope this helps,
John
I generated a type DBTable --> which has Row(s)
e.g.,
LINTEITEM-->DBTable --->Row(s) --->Column names

My Output card is mapped to DBTable,will this be considered a series object ?

Otherwise i have to figure out a way to make DBTable a series object.
You will want to call your functional map in the Row(s) element. That is your series object.

Posted: Tue Apr 25, 2006 8:18 am
by jackcool
That worked!!. i just changed the series object from DBTable to ROW(s).
Thanks alot guys.
Special Thanks to John for your help.

Posted: Tue Apr 25, 2006 11:04 am
by jgibby
No problem. I'm finding I actually do learn a lot by staying on top of the forums here and at Ascential/IBM DeveloperNet. I enjoy being able to answer or help and that has kept me interested in staying involved.

Thanks,
John