Bruce Momjian wrote:
> How are statement level triggers supposed to work? Are they just
> triggers deferred until the end of the statement? You mentioned access
> to the affected rows, but I don't understand how that is supposed to
> happen.
I'm not sure this is a fair assessment of statement level triggers. Yes,
in MSSQL you can access the rows involved in the statement, but in
Oracle you cannot (emphasis added):
"Accessing Column Values in Row Triggers
Within a trigger body of a *row trigger*, the PL/SQL code and SQL
statements have access to the old and new column values of the current
row affected by the triggering statement..."
See:
http://www.engin.umich.edu/caen/wls/software/oracle/appdev.901/a88876/adg13trg.htm#526
MSSQL does not have row level triggers at all (I know they didn't in
6.5, and looking at the help file it doesn't appear that they were added
even in MSSQL 2000), so access at the statement level is needed to do
anything useful at all.
"deleted and inserted are logical (conceptual) tables. They are
structurally similar to the table on which the trigger is defined, that
is, the table on which the user action is attempted, and hold the old
values or new values of the rows that may be changed by the user action."
Joe