Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Deferred trigger ..?

Re: Deferred trigger ..?

From: Tony Andrews <andrewst_at_onetel.com>
Date: 12 Jul 2005 06:35:28 -0700
Message-ID: <1121175328.096351.138790@g47g2000cwa.googlegroups.com>


Randi W wrote:
> These will be treated as two statements, so what I would really like is if
> the after-statment-trigger could be fired at COMMIT time. A similar thing
> can be done by using 'deferred'-setting for constraints.
>
> Is it possible?

No, but what you can do is use a combination of triggers and a deferred CHECK constraint. For example, you could add a column called NumCurrentAddresses to the Persons table, with a deferred CHECK constraint to ensure it is <= 1. Then use triggers on the Address tables to update the new column after inserts, updates and deletes.

Another possible approach is to create a materialized view that selects only the Address rows where IsCurrent=1, and then add a deferred unique constraint on the MV's person_id column. Received on Tue Jul 12 2005 - 08:35:28 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US