Subject | Triggers and referential integrity |
---|---|
Author | Tim Ledgerwood |
Post date | 2003-10-21T08:13:15Z |
Hi everyone,
I am busy building a database that enforces strict referential integrity. I
have been advised not to use foreign keys in certain circumstances, as it
would severely degrade the database performance. In order to enforce the
same referential integrity, I would like to use triggers to prevent the
user deleting or changing a record where the record is referenced by
another table.
I have looked through the documentation, but the documentation I have
doesn't deal with this at all - rather, it has examples of inserting and
updating records in other tables. It doesn't have examples of how to
prevent anything happening if there is data that depends on the table.
So how do you prevent an insert, deletion or update happening in a trigger?
I mean, how do you prevent it happening to the table the trigger belongs to?
Thanks in advance
Tim
[Non-text portions of this message have been removed]
I am busy building a database that enforces strict referential integrity. I
have been advised not to use foreign keys in certain circumstances, as it
would severely degrade the database performance. In order to enforce the
same referential integrity, I would like to use triggers to prevent the
user deleting or changing a record where the record is referenced by
another table.
I have looked through the documentation, but the documentation I have
doesn't deal with this at all - rather, it has examples of inserting and
updating records in other tables. It doesn't have examples of how to
prevent anything happening if there is data that depends on the table.
So how do you prevent an insert, deletion or update happening in a trigger?
I mean, how do you prevent it happening to the table the trigger belongs to?
Thanks in advance
Tim
[Non-text portions of this message have been removed]