Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How do I know the depth a particular record is at (hiera
Message
De
11/01/2008 19:04:59
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivie
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Versions des environnements
Visual FoxPro:
VFP 9 SP1
Database:
Firebird
Divers
Thread ID:
01281252
Message ID:
01281284
Vues:
7
This message has been marked as a message which has helped to the initial question of the thread.
>Hi all
>
>I have a self-joined kind of table where iID is the PK and iPID is the parent records FK in the same table.
>
>Now I am at a particular record and I want to know how deep this record is in the heirarchy. The reason is I don't want to allow changing of the iPID for the first and second level records as they are default records and should not be disturbed.
>
>Thanks and regards.

I think you will just have to create a UDF that goes all the way to the root and counts the levels.

You might also consider saving the level as part of the data, to avoid those searches.
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform