Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> Re: Circular FK's

Re: Circular FK's

From: david wendelken <davewendelken_at_earthlink.net>
Date: Fri, 4 Nov 2005 10:55:22 -0500 (GMT-05:00)
Message-ID: <1085540.1131119722809.JavaMail.root@elwamui-royal.atl.sa.earthlink.net>

>Has anyone ever seen a reason for two tables to have foreign keys on
>each other (different columns)?

Yes!

Multi-company accounting system, with "company" as the primary table. Almost every other table had a FK (direct or indirectly via another table) to it. This included some reference code tables, as different companies might want different sets of reference codes for the same purpose.

The company table had optional fks to some of the reference tables in order to store "default" reference codes for certain purposes.

Now, I will grant you that it probably would have been better to split that portion of the company table into a separate table to simplify the DBA's work later, but we learn by doing - sometimes well after we did it... :)

--
http://www.freelists.org/webpage/oracle-l
Received on Fri Nov 04 2005 - 09:57:26 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US