Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: not using foreign keys?
spacemarine_at_mailinator.com wrote:
> hello,
>
> i have a question -- is the practice of using FKs to maintain
> referential integrity an argued (for/against) practice? im now on an
> enterprise banking project, and the db designer does not use FKs, he
> feels it creates a "closed system", and prefers to have the coders
> manage constraints via procs.
>
> id never seen this before, but he said its an age-old argument (w/
> merits) and one he adheres to. is this so, or is it an unusual
> personal preference?
>
> i dont do much of the db work, but im just curious.
>
>
> thanks
> sm
>
Sounds like its time to get someone else on the project. Always let the Oracle engine enforce referential integrity through FK constraints. Doing so with a stored proc is not the way to go. How does the developer guarantee that the proc gets run when a row of data is INSERTed into the table? With a FK constraint, you don't have to worry about that.
A worse approach would be to let the application handle the referential integrity. But don't get me started on that....
HTH,
Brian
-- =================================================================== Brian Peasland dba_at_nospam.peasland.net http://www.peasland.net Remove the "nospam." from the email address to email me. "I can give it to you cheap, quick, and good. Now pick two out of the three" - Unknown -- Posted via a free Usenet account from http://www.teranews.comReceived on Mon Jun 04 2007 - 13:33:20 CDT