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

Home -> Community -> Usenet -> c.d.o.misc -> Which trigger fires first?

Which trigger fires first?

From: Peter Laursen <ptl_at_edbgruppen.dk>
Date: 30 Jul 1999 08:49:02 GMT
Message-ID: <01beda71$8e139440$2c289a0a@apollo>


If there exists two triggers on a table that are both 'before insert or update' how can I know which trigger fires first? Can I specify a sequence, ie tell the db i want this trigger to fire first?

I my db I have on each table a 'before insert or update' trigger that fetches a sequence.nextval into the primary key and updates others fields common to all tables. These triggers are all alike and made after a template. I dont want to edit these individually.

However i want to write triggres to enforce constraints on individual tables like:
create table t(a int primary key, b int references t) with the rule that b may be null, and at most one row can be referenced by another.
How do I write an efficient trigger to enforce this? (assuming a trigger as mentiod above is in place)

Thanks
Peter Received on Fri Jul 30 1999 - 03:49:02 CDT

Original text of this message

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