Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Maintaining 1 - 1 relationships
Message
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00506752
Message ID:
00506767
Vues:
19
>I have a situation where we have several converted legacy apps that are maintaining 1-1 relationships, in some cases between up to 5 tables.
>
>The tables are not in a DBC, and integrity does not appear to checked with much frequency.
>
>Anyone got any ideas on ways to improve this situation ( tips, code etc. ) The most obvious way I can see is to lump all the fields together into a single table and share it between the apps ( this leaves a huge field redundancy ).
>
>Any help is appreciated,
>
>Craig.

About all you can do to maintain integrity is to issue SQL periodically to find RI problems. Other than that, you can do edit checks in the APP before adding new records. An example SQL would be:

select foreignkey, count(foreignkey) kount from table2 ;
group by foreignkey having kount > 1

You would issue that on all child tables that have to maintain a 1-to-1 relation with the parent. You would then have to process all the returned foreign keys to remove multiple FKs.
Mark McCasland
Midlothian, TX USA
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform