Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Enforcing referential integrity - database or application?

443806Feb 2 2007 — edited Feb 13 2007
If this is issue has already been threshed out and I am the umpteenth person to ask this in the forum, please let me know and point me to a URL. I have believed in embedding as much logic in the database as possible, and would like to know if I am wrong in believing that.

Foreign keys are tailor made for enforcing referential integrity, and thereby implementing valuable business constraints at a very fundamental level, so that no one - including the application programmer - can mess with them.

However, I have had people tell me that instead of implementing foreign keys, they embed referential integrity checks on their application code that puts data in the database. I don't understand this. What possible advantage would accrue by using the application (viz. PL-SQL, or Java or whatever) to do what the FK does extraordinarily well, and probably, a lot faster too?

Thanks,

Regards,

Srini
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 13 2007
Added on Feb 2 2007
38 comments
2,833 views