|
From: Walden H. Leverich
I really have a hard time with edits in a before trigger, in amaintenance
program, and in a constraint. What if the before trigger thinks thethe
maintenance program will handle it, and the maintenance program thinks
constraint will handle it?
I view it the other way. It's not that the DB (constraint) should handle
the edit, it's that it's a last-line-of-defense against any program that
doesn't handle the edit.
Inserting data into a table without checking the constraints much
earlier in the program stack is just silly. Sure, you can handle the
error, decode the constraint name, and somehow notify the user in a
friendly manner from 7 program calls deeper in the stack, or you can
just check for the error in the UI in the first place and give the user
a friendly message.
The point of a constraint is to tell the db how to protect itself from
_any_ unchecked updates. Say, DFU, DBU, ODBC, whatever.
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.