Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: composite foreign key one field constant?
ddwoske_at_yahoo.com (Don Dwoske) writes:
> There are differing opinions on this point, and at the moment, I just
> don't see how it could create complicated and buggy sql down the road.
>
I find the approach of using a single code table to store multiple
types of codes has a number of problems -
If I think about it more, I can probably come up with a lot more reasons. The only arguments for a single code table seems to be that its easier to maintain 1 table rather than many and data input may be easier. However, I'm not convinced by these arguments. Code tables have a very low maintenance cost in my experience and they are often of a very similar format, so you can usually re-use large amounts of code used to handle data input/update to the code tables.
I have been working with an application which has a large single code table and I find the additional work required in DML because of this multi-type code table is a constant frustration. In this particular application, new codes are rarely added (a couple of times a year and not that many even then) and existing codes are never changed. Much of the SQL used by the application looks a lot more complex and is often more difficult to deconstruct simply because of the additional qualifiers required whenever the coe table is referenced in any way.
Tim Received on Thu Nov 21 2002 - 15:53:43 CST
![]() |
![]() |