Protect record from deletion via trigger

From: <markus.schreyer_at_gmail.com>
Date: Tue, 1 Jul 2008 08:20:34 -0700 (PDT)
Message-ID: <ecbe7664-2f0a-4f46-8e87-0ffb174b1c68@e53g2000hsa.googlegroups.com>


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.. :) Received on Tue Jul 01 2008 - 10:20:34 CDT

Original text of this message