Scalable Database Server, HiRDB Version 8 Description
By defining a trigger, you can have SQL statements automatically execute when an operation (updating, insertion, deletion) is performed on a particular table. A trigger defines such specifications as the table to which the trigger applies, the SQL statement that activates the trigger (trigger event SQL), the SQL statements that are to be executed automatically (trigger SQL statements), and conditions for execution of the action (trigger action search conditions). When an SQL statement that satisfies the trigger action search conditions is executed on a table for which a trigger is defined, the trigger SQL statements are automatically executed. Figure 5-6 provides an overview of triggers.
Figure 5-6 Overview of triggers
Note, however, that when you define a trigger for a table, you must re-generate any function, procedure, or trigger SQL object that uses that table, because any SQL object that uses that table becomes invalid. Similarly, if you define, change, or delete any resources that are used by the trigger (tables, indexes, and so on), the trigger SQL object becomes invalid, so you must re-generate it as well. For details, see the HiRDB Version 8 Installation and Design Guide.
Consider using a trigger to perform the following actions when an associated UAP operation occurs:
When you define a trigger, an SQL object that codes the specified trigger action procedure is automatically generated and stored in the corresponding data dictionary LOB RDAREA. Thus, before you define a trigger, you must make sure that the data dictionary LOB RDAREA has sufficient capacity. For details about how to estimate the capacity of data dictionary LOB RDAREAs, see the HiRDB Version 8 Installation and Design Guide.
In addition, if you plan to execute trigger event SQL statements, you must also take into consideration the trigger SQL object size when you specify the buffer length for SQL objects. For details about how to estimate the buffer length for SQL objects, see the manual HiRDB Version 8 System Definition.
The following definition SQL statements are used to define a trigger, to re-generate an SQL object, and to delete a trigger.
All Rights Reserved. Copyright (C) 2007, Hitachi, Ltd.