Re: Informix and trees
Posted in 1997
Topics: Jobs, Consulting & Announcements
Hi, Try using the JOE CELKO's method. Build a table , say tree . Then ELEMENT LEFT_VALUE RIGHT_VALUE are the columns of the table. Start number the left side of the tree. Proceed down until you hit the leaf of the tree. Once you hit the leaf, move right and number it. Those numbers you allocate in the left has to be stored in the LEFT_VALUE column and those numbers you allocate right of the tree has to be stored in RIGHT_VALUE column. Then you will observe, the tree with the highest difference between the left_value and Right_value is the top level root.The one with the lowest value is the leaf of the tree. I am not able to view the tree in your case. If you could e-mail me in parent and child form instead of pictorically representing, I can be of some help to you . Harinath Venkata Systems Consultant New York On 1 Oct 1997 08:16:34 GMT hubert_stueken_gmbh_u_co@t-online.de (Gerhard Albrecht) writes: }hello, } }I am looking for an example to search in an database which has stored }the data like a tree. The actual problem for example is a tree of }production processid's (pid). The root of the tree is the }material-id (pid). Every production process to change the material up }to the productionoutput generates a new pid. } }Example: } } pid1 } | } --------------------------- } | | | } pid2 pid3 pid4 } | | | } | -------------- } | | } pid5 pid6 } | | } --------------------------------------- } | | | | } pid7 pid8 pid9 pid10 } | | | | } --------------------------------------- } | } pid11 } }For example I have got the pid8 and have to now all pid's before in }the tree (pid 1 to 6). Sometimes it's enough to find the root. }We are using the INFORMIX-SE environment. } }My questions: }1. how to build the table ? }2. how can I generate a simple select to get all affected pid's ? } } }best regards } }Dirk Niemeier }Hubert Stueken GmbH & Co. }Rinteln-Germany }