Re: Protect record from deletion via trigger

From: <fitzjarrell_at_cox.net>
Date: Tue, 1 Jul 2008 08:52:28 -0700 (PDT)
Message-ID: <85ecb829-d117-460c-ae25-9dd09708c353@m36g2000hse.googlegroups.com>


On Jul 1, 10: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
> TRIGGER
> PROTECT_REC
> BEFORE DELETE ON TARGETTABLE
> FOR EACH ROW
> BEGIN
>   IF (:old.PKCOL=1) THEN
>    Null;
>   END IF;
> END;
>
> Thanks.. :)

Not without throwing an error since you state you cannot use a view and an instead of trigger.

What is the business reason for this 'requirement'?

David Fitzjarrell Received on Tue Jul 01 2008 - 10:52:28 CDT

Original text of this message