SQL/MX 2.x Reference Manual (G06.24+, H06.03+)

SQL/MX Statements
HP NonStop SQL/MX Reference Manual523725-004
2-234
UPDATE Statement
search-condition array are updated using the second element in the
set-clause array, and so on.
For information on using host variables and rowsets, see the SQL/MX
Programming Manual for C and COBOL.
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-39.
Pub/Sub
Embed