0

Using IBM Websphere Transformation Extender...

I'm working on a scenario where there are parent/child relationships and the input data and I want to maintain that parent/child relationship in two database tables. The data is similar to this:

Parent/Child Indicator,Fname,Lname,Age

P-Bob,Smith,32
C-Sally,Smith,4
C-Tommy,Smith,6
P-Chris,Gomez,65
C-Anna,Gomez,32

I want to put all the parents in their own db table and the children in a separate table.

My thought as to how to accomplish this would be to create a functional map for the parent rows, capture it's data (along with db auto-generated primary key) and insert into the parent table. Then within that functional map, I would create another functional map for each child row and pass the PK from the parent table to establish a relationship between the two tables.

Is that the correct approach for a relational database? If so, I can't seem to get it working correctly because I can't seem to change the output cards within the nested functional maps to point to the right db table and insert correctly. Anyone with any thoughts on this situation would be greatly appreciated. Thank you.

  • This question might be more appropriate to dba.stackexchange.com – Gordon Seidoh Worley Jun 06 '13 at 17:58
  • This is specific to carrying variables between nested functional maps within WTX; I dont think the dba forum would know the answer to this as it is application specific. Unfortunately WTX is more of a niche product....just hoping I could find someone who has done something similar. Thanks. – Chris Hogan Jun 07 '13 at 16:28

1 Answers1

0

You can do the binding of the data on the type tree that reads it.

Assuming your example, your type tree can be something like:

Family (Group)[0:S](
    Parent (Group)(Initiator P, Fname text, Lname text, Age number)[1]
    Child (Group)(Initiator C, Fname text, Lname text, Age number)[1:S]
)

Then you can easily process each family member on a functional map like:

=F_LoadFamily(Family, DBLOOKUP(get auto primary key))

Inside the functional map you have several options:

  • Call one stored procedure which will do the inserts on the respective tables depending if it is a parent or a child.
  • Call another functional map depending on the record you want to insert

etc.

Scallops
  • 41
  • 3