Trigger Inheritance in a Table Hierarchy

By default, any trigger that you define on a typed table of HCL OneDB™ is inherited by all its subtables.

In versions of HCL OneDB earlier than version 11.10, however, if you define a trigger on a subtable of a typed table, that trigger overrides any trigger for the same type of triggering event (Select, Delete, Insert, or Update) that the subtable inherits from its supertable. In this version of HCL OneDB, however, a table can inherit more than one trigger that the same triggering event activates, so both triggers are defined for the same type of event on the subtable.

In all versions of HCL OneDB, a trigger that you set on a subtable is inherited by all its dependent tables, but has no effect on its supertable.

This behavior is important when you require a trigger to be enabled in a supertable, but to be disabled in its subtable. In HCL OneDB 10.00 and in earlier versions, you cannot use the SET TRIGGERS option of the SET Database Object Mode statement to disable an inherited trigger selectively within a hierarchy. In this release, however, disabling a trigger on a table within a table hierarchy has no effect on inherited triggers. For example, the following statement has no effect on triggers on table objects that are above or below subtable within a table hierarchy:
SET TRIGGERS FOR subtable DISABLED

Similarly, the DROP TRIGGER statement cannot destroy an inherited trigger without also destroying the trigger on the supertable. In this situation, you must instead define a trigger with no Action clause on the subtable. Because triggers are not additive, this empty trigger overrides the inherited trigger and executes for the subtable and for any subtables under the subtable, which are not subject to further overrides.