Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Maintaining 1 - 1 relationships
Message
 
 
To
14/05/2001 08:03:33
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00506752
Message ID:
00506767
Views:
18
>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
Previous
Reply
Map
View

Click here to load this message in the networking platform