Re: Triggers Problem

From: Kevin Owens <keowens_at_delphi.com>
Date: Thu, 13 Oct 94 07:41:39 -0500
Message-ID: <R660hbj.keowens_at_delphi.com>


When you insert into a detail record Oracle needs to read the master table in order to enforce the integrity constraint. Since Oracle does not know if this is a multi-row insert into the master table then the master table is still in a state of being updated. See Oracle Applications Dev guide 8-9 You are probably more interested in the solution at this point. We have implemented hundreds of business rules with Oracle triggers and here is how we solved this problem. First of all we always coded to handle multi-row insert/update/delete. We created PL/SQL tables in packages. The table is cleared in a before-statement trigger; populated with :new/:old correlation values at the row-level trigger (for each row of the multi-row) statment; then read the table and perform the original operation in the after-statement trigger. There are code examples in the October issue of DATABASE Programming and Design Magazine, Miller Freeman Press, try 800-444-4881 for .....try
...try 800-444-4881 for back issues. Received on Thu Oct 13 1994 - 13:41:39 CET

Original text of this message