Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Family tree
Message
From
02/10/2009 09:11:39
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
Environment versions
Visual FoxPro:
VFP 9
Miscellaneous
Thread ID:
01427275
Message ID:
01427293
Views:
69
Unfortunately SQLServer is not an option.

Peter


>>I have to create a family tree of sorts.
>>since everyboy has ONE mother and ONE father only I created a table :
>>table 1: Person_id, Father_id, Mother_id (relatives)
>>table 2: person_id, spuse_id, startdate,enddate (spouses)
>>
>>
>>now given a certain person I need to identfy all of his/her relatives
>>
>>like:
>>
>>Peter
>> Alex, father
>> Anna, mother
>> Louis, Grandfather
>> Anita, Grandmother
>> Karl, grandfather
>> Hilde, grandmother
>> Nici, child
>> Susi, child
>> Anna, child
>> karl, child
>> Till, grandchild
>> Jana, grandchild
>> Heimo, sibling
>> Uli, Sibling
>>......
>>
>>
>>has anybody done something like this before and is willing to share
>>maybe anybody has better ideas how to accomplish this
>>
>>
>>this is similar to a bill of material, but with 2 pointers (parent, parent, child) rather 1 pointer (parent, child)
>>
>>Thanks
>>
>>
>>Peter
>
>I would suggest you to move your data to SQL Server, run hierarchical CTE, then send result back to VFP. See http://blogs.lessthandot.com/index.php/DataMgmt/DataDesign/cte-and-hierarchical-queries and links from it for details. See also
>http://forums.asp.net/p/1476562/3435665.aspx#3435665 for somewhat similar problem.
Peter Cortiel
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform