UPDATE statement
Parameters
638
It provides a full list of SUBSCRIBE BY values any time the list changes. It
is placed in SQL Remote triggers so that the database server can compute the
current list of SUBSCRIBE BY values. Both lists are placed in the
transaction log.
The Message Agent uses the two lists to make sure that the row moves to any
remote database that did not have the row and now needs it. The Message
Agent also removes the row from any remote database that has the row and
no longer needs it. A remote database that has the row and still needs it is not
be affected by the UPDATE statement.
For publications created using a subquery in a SUBSCRIBE BY clause, you
must write a trigger containing syntax 3 of the UPDATE statement in order
to ensure that the rows are kept in their proper subscriptions.
Syntax 3 of the UPDATE statement allows the old SUBSCRIBE BY list and
the new SUBSCRIBE BY list to be explicitly specified, which can make
SQL Remote triggers more efficient. In the absence of these lists, the
database server computes the old SUBSCRIBE BY list from the publication
definition. Since the new SUBSCRIBE BY list is commonly only slightly
different from the old SUBSCRIBE BY list, the work to compute the old list
may be done twice. By specifying both the old and new lists, you can avoid
this extra work.
The SUBSCRIBE BY expression is either a value or a subquery.
Syntax 3 of the UPDATE statement makes an entry in the transaction log,
but does not change the database table.
UPDATE clause
The table is either a base table, a temporary table, or a
view. Views can be updated unless the SELECT statement defining the view
contains a GROUP BY clause or aggregate function, or involves a UNION
operation.
FIRST or TOP clause
clause allows you to update only a certain subset of the rows that satisfy the
WHERE clause.
SET clause
If you are updating non-Java columns, the SET clause is of
the following form:
SET column-name = expression , ...
Each named column is set to the value of the expression on the right hand
side of the equal sign. There are no restrictions on the expression. If the
expression is a column-name, the old value is used.
If you are updating Java columns, you can use field-name to update the value
of a public field in the column. Alternatively, you can use a method to set the
value. The following clause updates name field of the JProd column using a
method:
Primarily for use with the ORDER BY clause, this
Need help?
Do you have a question about the Adaptive Server Anywhere and is the answer not in the manual?
Questions and answers