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 -> trigger questions (on principle)

trigger questions (on principle)

From: Andreas Mosmann <keineemails_at_gmx.de>
Date: Tue, 23 Aug 2005 12:14:40 +0200
Message-ID: <1124792080.7@user.newsoffice.de>


Hi ng,

there is a database with
- a schema DAT that contains the Data including all Tables and integrity
triggers that are necessary.
- a schema PRG that contains Data related to the Application (Menus,
Forms ...)
- a schema LOG that is only for protocolling of changes in main tables
of schema DAT

My questions are the following:
1.)
For integrity/redundancy there is a trigger in schema DAT like

CREATE Trigger1 BEFORE INSERT ON TableA OF Field1 FOR EACH ROW

Besides I need a Trigger like
CREATE Trigger2 BEFORE INSERT OR UPDATE ON TableA OF Field2 FOR EACH ROW

Should I
a) only create 1 Trigger like
CREATE TriggerBoth BEFORE INSERT OR UPDATE ON TableA OF Field1,Field2 FOR EACH ROW in which I decide whether I insert or update and which Field is implicated

b) create 1 Trigger for each field
c) create 1 Trigger for each event

2.)
If there are changes in an important Table the changes are to store in a ChangeLog- Table, so that every state of a record can be controlled if necessary.
So I want to write Triggers like

CREATE TriggerChange1 BEFORE INSERT OR UPDATE ON TableA FOR EACH ROW CREATE TriggerChange2 BEFORE DELETE ON TableA FOR EACH ROW

that creates a row in TableChangeLog.
I would prefer to seperately store the Triggers TriggerChange1 and TriggerChange2 in the schema LOG but is there a possibility to manage that
a) the ChangeLog- Triggers are called last b) the ChangeLog- Triggers only are fired if a real change took place (if the other Triggers abort these Triggers are to abort either?

Should be written instead of this stored procedures in LOG that are fired by triggers from schema DAT?

Hope I articulated understandable ...

Thanks

Andreas

-- 
wenn email, dann AndreasMosmann <bei> web <punkt> de
Received on Tue Aug 23 2005 - 05:14:40 CDT

Original text of this message

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