Re: Protect record from deletion via trigger
Date: Tue, 1 Jul 2008 10:38:58 -0700 (PDT)
On Jul 1, 11:20 am, "markus.schre..._at_gmail.com" <markus.schre..._at_gmail.com> wrote:
> Hi all,
> I have a question regarding delete triggers. is there a way to protect
> one specific record of a table from deletion? The way to do it with a
> view and instead triggers is not possible. Also i can't raise an
> APPLICATION_ERROR, since the whole thing should not be visible from
> application side. Is there a way to do this?
> CREATE OR REPLACE
> BEFORE DELETE ON TARGETTABLE
> FOR EACH ROW
> IF (:old.PKCOL=1) THEN
> END IF;
> Thanks.. :)
Tom Kyte says ( and I believe him ) "Triggers are evil" ... therefore don't use them at all or at least minimize their usage.
Certainly don't try to protect a specific record within a trigger that is just madness!
You could I suppose have a procedure that looks to see if a certain record is there and inserts it/updates it if it has gone away ... execute that on some periodic basis if you must. Received on Tue Jul 01 2008 - 12:38:58 CDT