Focal Point
How to update multi-path with Maintain?

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/8921029942

October 03, 2007, 10:51 AM
Charlotte
How to update multi-path with Maintain?
We are trying to update two separate paths of data with one Maintain program. I know we need two separate stacks, but the developer can not get the second path of data to update at all. Can anyone out there provide any suggestions?

Our PM has suggested redesigning the database (which will be extremely inefficient) in order to eliminate the problem, but as the DBA I would certainly hope that Maintain can do multi-paths.

PLEASE HELP
Charlotte


Cha
October 04, 2007, 10:06 AM
Maintain Wizard
Hi Charlotte
In order to update multiple paths, you need to have multiple stacks and the keys to ALL of the parent segments need to be populated. For example, with the CAR file, to cover all the segments, you would need:

INFER COUNTRY CAR MODEL BODYTYPE SPECS INTO STK1
INFER COUNTRY CAR WARRENTY INTO STK2
INFER COUNTRY CAR STANDARD INTO STK3

In order to update the entire file you would have to populate the COUNTRY and CAR segments for all of the stacks and then populate the other segments for each of the stacks.

I believe, in your case, TLOGSTK does not contain all of the date for the DESCDATA segment before you are updating. It is easy to test this. Before the update statement, print out all of the key fields for all 3 segments.. Make sure they are all populated.

Mark Derwin
October 04, 2007, 10:57 AM
Maintain Wizard
Charlotte
I just reviewed the code that you are using to update multiple paths in the Master and here is the problem.

You have create a stack from the data base, and added computed fields in the stack with the same names as the fields in the other segment. This is one way of getting around the multi-path issue. However, in this case you cannot use the COPY command to move fields from one stack to the other. You must create a loop and COMPUTE the data in. This is because, while the new computed fields in the stack have the same name and format as the database fields, they are not actually the database fields. So create a loop, and compute the values from one stack to the other.

Mark