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

Re: trigger questions (on principle)

From: Jim Kennedy <kennedy-downwithspammersfamily_at_attbi.net>
Date: Tue, 23 Aug 2005 06:33:27 -0700
Message-ID: <btednezeMY_AuJbeRVn-og@comcast.com>

"Andreas Mosmann" <keineemails_at_gmx.de> wrote in message news:1124792080.7_at_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

Have one trigger that calls 2 stored procedures. Jim Received on Tue Aug 23 2005 - 08:33:27 CDT

Original text of this message

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