Re: Protect record from deletion via trigger

From: Vladimir M. Zakharychev <>
Date: Wed, 2 Jul 2008 06:14:33 -0700 (PDT)
Message-ID: <>

On Jul 2, 11:37 am, "" <> wrote:
> Hi joel,
> can you give me some details about this child table idea. I don't get
> it yet.. =) sorry.. :)
> Markus

You just create another table and add foreign key constraint to it referencing your table. You then insert single row into the "child" table with the foreign key pointing to the row in the "master" table you want to protect. Now if someone tries to delete that row, Oracle will throw ORA-02292 because a child row exists for it. Note that foreign key constraints require primary or unique key constraint on the master table to be in place. Your app should also be able to handle the error adequately.


   Vladimir M. Zakharychev
   N-Networks, makers of Dynamic PSP(tm) Received on Wed Jul 02 2008 - 08:14:33 CDT

Original text of this message