Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Best Practice - Internal Code field for Heirarchial tabl
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00937935
Message ID:
00939061
Vues:
19
Hi Javier

Thanks for your view point. Acutally this cCode business was getting me scared so I had put up this thread. What scared me is when clients want to change parent of a given record, then the whole of cCode will change depending on how far away the parent is from the current parent. Secondly I am self joining the table, so I don't have a Family table (I have tried a family thing in a DOS based application and I have my own regrets <g>). This question was raised from my (shall we say bad <g>) experience with Accounts and Items hierarchy, so one thing I had decided was to have one table for the whole structure and now came the time for reporting, so I though asking for records with a cCode of "001003005" should be easy, but then management of cCode raised some alarm bells and I was keen to nip it in the bud.

Now if you have followed the thread Cetin has helped resolve this cCode issue with 2 fields iLevel and iRootID for reporting purposes and we should be able to get similar results with (roughly) iLevel = 3 and iRootID = 1 (cCode = "001003005").

Yet I am still on the lookout to even avoid them and get results, for eg. I know an Item which has a unique id iID = 26. I guess there is a way to Self-Join the table to get iID = 26 and it's children, grand chilren, so on, into a cursor containing iID field for all of them. Get that and you can find all kinds of transactions for these items in an SQL WHERE iItemID IN (SELECT iID FROM myCursor) No management issues, yipee. What say?
Regards
Bhavbhuti
___________________________________________
Softwares for Indian Businesses at:
http://venussoftop.tripod.com
___________________________________________
venussoftop@gmail.com
___________________________________________
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform