HP Neoview SQL Reference Manual page 99

Hide thumbs Also See for Neoview SQL:
Table of Contents

Advertisement

triggers are used to condition input data, while AFTER-type triggers encode actual application
logic.
Restrictions on Triggers
The trigger feature does not allow the use of:
— Positioned deletes and updates as triggered statements.
— Subqueries in search-condition for AFTER triggers (but they are allowed in
search-condition for BEFORE triggers.)
To create a trigger on a given table, the name of the table should be at least six characters
less than the maximum length of a valid table name (128 characters).
There is a compile time limit of 256 triggers for each statement. This means if the statement
has the potential to activate more than 256 triggers (not necessarily different triggers, there
could be one or more recursive triggers), an error is raised. The restriction applies regardless
of whether a trigger is disabled or enabled and whether the trigger may or may not be
activated.
Reserved Trigger Names
Trigger names prefixed by the name of a user metadata table are reserved. You cannot create
triggers with such names. For example, you cannot create triggers that are prefixed by these
names:
HISTOGRAMS
HISTOGRAM_INTERVALS
MVS_UMD
MVS_TABLE_INFO_UMD
MVS_USED_UMD
Recompilation and Triggers
User applications that change (INSERT, UPDATE, or DELETE) information in a table require
compilation when a trigger with a matching event is added or dropped. User applications that
use a SELECT on the subject table do not require recompilation. User applications do not require
an SQL compilation when a trigger is changed from DISABLED to ENABLED, or from ENABLED
to DISABLED, using the ALTER TRIGGER statement. User applications require SQL
recompilations only when triggers are added or dropped. No source code changes or language
compilations are required.
Triggers and Primary Keys
When creating a trigger on a table, the table's clustering key must be 16 bytes shorter than the
maximum allowed key length for regular tables. This is because a trigger causes an internal,
hidden trigger temporary table to be created. The clustering key of the trigger temporary table
is the key of the table plus some internal columns, which add 16 bytes to the key length.
Suppose you create this table:
CREATE TABLE t1( c1 varchar(2040) NOT NULL,
When you try to create a trigger on this table, you receive errors:
*** ERROR[1085] The calculated key length is greater than 2048 bytes.
*** ERROR[11041] Temporary table could not be created! Check default partitions.
c2 int,
c3 int,
c4 char(3),
c5 char(3),
primary key (c1)
);
CREATE TRIGGER Statement
99

Advertisement

Table of Contents
loading

Table of Contents