Select Triggers in Table Hierarchies

A subtable in the HCL OneDB™ database inherits the Select triggers that are defined on its supertable. When you select from a supertable, the SELECT statement activates the Select triggers on the supertable and the inherited Select triggers on the subtables in the table hierarchy.

For example, assume that table tab1 is the supertable and table tab2 is the subtable in a table hierarchy. If the Select trigger trig1 is defined on table tab1, a SELECT statement on table tab1 activates the Select trigger trig1 for the rows in table tab1 and the inherited Select trigger trig1 for the rows in table tab2.

If you add a Select trigger to a subtable, this Select trigger does not override the Select trigger that the subtable inherits from its supertable, but increases the number of Select triggers on the subtable. For example, if the Select trigger trig1 is defined on column col1 in supertable tab1, the subtable tab2 inherits this trigger. If you define a Select trigger named trig2 on column col1 in subtable tab2, and a SELECT statement selects from col1 in supertable tab1, this SELECT statement activates trigger trig1 for the rows in table tab1 and both triggers trig1 and trig2 for the rows in table tab2.