(list manager's note: This message is actually from William Mason
[EMAIL PROTECTED], but was screened out because of a word
at the beginning of a line that looked to the list server software like a
request for a change in membership. -- wdd )
Two problems:
First, this is not the order that events are firing per my tests. Triggers
fire first.
Second, why would a trigger fire BEFORE an event that could potentially
abort the event that initiated it? If the below order is to be
implemented, what would happen if a rule prvented the action from
occurring?
Why should the trigger fire? The order that would maintain integrity would
be the order that one would find in larger platforms such as SQL Server and
Sybase - triggers only fire after all other events have succeeded. What if
a trigger was set to delete FK records if an event occured on a PK record
and a rule prevented the action on the parent record - would you want the
FK
records to still be deleted?
Items such as rules and constraints are PROACTIVE - they happen prior to
the
requested event and allow/disallow the action. Triggers need to be
REACTIVE - they react to a successful action.
----- Original Message -----
From: "A. Razzak Memon" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, May 02, 2001 8:03 PM
Subject: From The Edge: Which process activate first!
>
> May 2, 2001
>
> ====================================================
====
===
> From the Edge: Which process activate first!
> Section: Stored Procedures and Triggers
> Platform: R:BASE 2000 (ver 6.5+) for DOS/Windows
> Build: 1.839xRT03 and Higher ...
> ====================================================
====
===
>
> A trigger automatically runs a stored procedure when an
> UPDATE, DELETE, or INSERT command is run with a table.
>
> R:BASE 2000 (ver 6.5+) and higher includes many bug-fixes
> and enhancements in reference to Stored Procedures and
> Triggers.
>
> The upcoming upgrade version of R:BASE 2000 version 6.5++,
> build 1.840J and higher will also include the bug fix for
> very old boo-boo related to leftover LOCKS with DELETE
> Triggers.
>
> Now, you all might be interested to know the sequence
> in which the data integrity is maintained when using
> the Stored Procedures and Triggers.
>
> Here's the order:
>
> DELETE
> -rules
> -cascades
> -triggers
> -keys
> -row itself
>
> UPDATE
> -rules
> -cascades
> -triggers
> -keys
> -row itself
>
> INSERT
> -rules
> -triggers
> -keys
> -row itself
>
> More to come ...
>
> Very Best Regards,
>
> Razzak.