Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Find Root+1 parent node in heirarchial table
Message
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00956896
Message ID:
00957956
Views:
11
Hi David

Thanks, that's nice. I haven't tried out the code yet but I seem to be getting the point we are looking from the parent in. But one problem I foresee is that I have to know if 7, 8 (via 7) and 9 (via 8, 7) belong to either 4 or 5 or 6.

Currently I have added a field containing DR or CR (this is still a fresh app so I had the liberty) to avoid this sort of query altogether and I do a replace as soon as the parent for a given node is changed.

Thanks for your help.

>
create cursor tree ( nodeno i, parentnodeno i )
>insert into tree values ( 1, 0 )
>insert into tree values ( 2, 0 )
>insert into tree values ( 3, 0 )
>insert into tree values ( 4, 1 )
>insert into tree values ( 5, 1 )
>insert into tree values ( 6, 1 )
>insert into tree values ( 7, 2 )
>insert into tree values ( 8, 7 )
>insert into tree values ( 9, 8 )
>select * ;
>   from tree ;
>   where tree.parentnodeno in ( select nodeno from tree where parentnodeno = 0 )
>
Regards
Bhavbhuti
___________________________________________
Softwares for Indian Businesses at:
http://venussoftop.tripod.com
___________________________________________
venussoftop@gmail.com
___________________________________________
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform