Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Finding orphan records
Message
De
23/01/2009 09:49:43
Jay Johengen
Altamahaw-Ossipee, Caroline du Nord, États-Unis
 
 
À
23/01/2009 09:41:13
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
Divers
Thread ID:
01376524
Message ID:
01376536
Vues:
16
>>If I have a table that could be tied to a couple other tables, which could have dependents themselves, how could I find records that have no parent/grandparents?
>
>I think you will have to do a subquery for every table that might contain child records, e.g.:
>
>
>select * from ChildTable;
>  where ParentKeyField not in (select ParentKeyField from ParentTable)
>
>
>You should avoid this situation in the first place, by using Referential Integrity. After correcting the orphan records, I would strongly suggest you implement RI.

I agree, but this is not production data. It is our test dataset that has had many things happen to it over the years with good/bad tested code gong on. I'm just trying to get it straight a bit so we cut down on the odd behaviors we get from the data so we can concentrate on the odd behaviors we get from our code. Our data uses RF now and is pretty solid, but historically...
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform