SQL/MX 2.x Reference Manual (H06.04+)

SQL/MX Statements
HP NonStop SQL/MX Reference Manual540440-003
2-229
UPDATE Statement
NULL
can also specify the value of the update source.
SET ON ROLLBACK set-roll-clause [,set-roll-clause]...
causes one or more columns to be updated when the execution of the UPDATE
statement causes its containing transaction to be rolled back.
set-roll-clause
sets the specified column to a particular value. For each set-roll-clause,
the value of the specified target column-name is replaced by the value of the
update source expression. The data type of each target column must be
compatible with the data type of its source value.
If you include a rowset search condition in the WHERE clause, you can use a
rowset expression in set-roll-clause, but it is not required. If the rowset
sizes are different in the SET and WHERE clause, the smaller of the two sizes
is used, and the remaining entries in the larger rowset are ignored. The rows
selected by the nth condition in the rowset search condition are updated by the
nth expression in the rowset expression in set-roll-clause.
column-name
names a column in table to update. You cannot qualify or repeat a
column name. You cannot update the value of a column that is part of the
primary key.
expression
is an SQL value expression that specifies a value for the column.
expression cannot contain an aggregate function defined on a column.
The data type of expression must be compatible with the data type of
column-name. A scalar subquery in expression cannot refer to the
table being updated.
If expression refers to columns being updated, NonStop SQL/MX uses
the original values to evaluate the expression and determine the new
value.
See Expressions on page 6-37.
rowset-expression
is an array of SQL value expressions that specifies values for the column.
A rowset-expression can appear in the SET ON ROLLBACK clause
only when a rowset-search-condition is present in the WHERE
clause.
The rows returned by the nth element in the rowset-search-condition are
updated by using the nth element in the rowset-expression. The rules
Pub/Sub
Embed