My Oracle Support Banner

Compound Trigger Variables Being Reset To NULL During DELETE CASCADE (Doc ID 1638849.1)

Last updated on AUGUST 04, 2018

Applies to:

Oracle Database - Enterprise Edition - Version 11.2.0.3 and later
Information in this document applies to any platform.

Symptoms

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.

Cause

To view full details, sign in with your My Oracle Support account.

Don't have a My Oracle Support account? Click to get started!


My Oracle Support provides customers with access to over a million knowledge articles and a vibrant support community of peers and Oracle experts.