Compound Trigger Variables Being Reset To NULL During DELETE CASCADE
Last updated on DECEMBER 06, 2016
Applies to:Oracle Database - Enterprise Edition - Version 188.8.131.52 and later
Information in this document applies to any platform.
There is a compound trigger that fires on INSERT, UPDATE, DELETE on a table.
In the BEFORE STATEMENT section, the code sets a 'global' variable defined
within trigger scope.
That variable is referenced in the BEFORE EACH ROW section.
If the trigger fires as the result of a 'direct' operation, all is fine. If
the trigger fires as the result of a ON DELETE SET NULL foreign key
constraint, again, all is fine.
If the trigger fires as the result of an ON DELETE CASCADE foreign key
constraint, the variable is correctly set in the BEFORE STATEMENT code but is
NULL in the BEFORE EACH ROW code.
Sign In with your My Oracle Support account
Don't have a My Oracle Support account? Click to get started
Million Knowledge Articles and hundreds of Community platforms