ALLBASE/SQL Reference Manual (36216-90216)

Chapter 10 347
SQL Statements A - D
CREATE RULE
FiringCondition
and
ParameterValue
to refer to the old values of the
row (before it was changed by the DELETE or UPDATE statement). The
default
OldCorrelationName
is OLD. If the
StatementType
is INSERT,
an
OldCorrelationName
will refer to the new values of the row, since no
old values are available.
NewCorrelationName
specifies the correlation name to be used within the
FiringCondition
and
ParameterValue
to refer to the new values of the
row (after it was changed by the INSERT or UPDATE statement). The
default
NewCorrelationName
is NEW. If the
StatementType
is DELETE,
a
NewCorrelationName
will refer to old values of the row, since no new
values are available.
FiringCondition
specifies a search condition the current row must meet once the rule's
statement type has matched before the rule can fire on that row. Refer to
the "Search Conditions" chapter for possible predicates.
The search condition must evaluate to TRUE to invoke the specified
procedure. The search condition cannot contain any subqueries, aggregate
functions, host variables, local variables, procedure parameters, dynamic
parameters, or the TID function.
[
Owner.
]
Procedure Name
specifies the procedure to invoke when a rule fires. The
procedure must exist when the rule is created.
ParameterValue
specifies a value for a parameter in the procedure. The parameter
values must correspond in sequential order to the parameters defined for
the procedure.
ParameterValue
has the following syntax:
{ NULL
Expression
}
The
Expression
may include anything allowed within an SQL expression
except a subquery, aggregate function, host variable, TID function, local
variable, procedure parameter, dynamic parameter, or a long column
value. Refer to the "Expressions" chapter for the complete syntax of
expressions. In particular, column references
are
allowed within the
EXECUTE PROCEDURE clause of the CREATE RULE statement. Column
references may be of the form:
{
OldCorrelationName.ColumnName
NewCorrelationName.ColumnName
[[
Owner
.]
TableName.
]
ColumnName
}
DBEFileSetName
specifies the DBEFileSet in which sections associated with the rule are
to be stored. If not specified, the default SECTIONSPACE DBEFileSet is
used. (Refer to syntax for the SET DEFAULT DBEFILESET statement.)