Chapter 7. SQL Remote Design for AdaptiveSer verAnywhere
UPDATEtable-list
SETcolumn-name =expression, . . .
[VERIFY (column-name,...)
VALUES(expression, . .. ) ]
[WHERE search-condition ]
TheVERIFY clause can be used only if
table-list
consistsof a single table.
Itcompares the values of specified columns to a set of expected values,
whichare the values that were present in the publisher database when the
UPDATEstatement was applied there. When the VERIFY clause is
specified,only one table can be updated at a time.
TheVERIFY clause is useful only for single-row updates. However,
multi-rowupdate statements entered at a database are replicated as a set of
single-rowupdates by the Message Agent, so this imposes no constraints on
clientapplications.
Conflictresolution tr igger
syntax Thesyntax for a RESOLVE UPDATEtrigger is as follows:
CREATETRIGGER trigger-name
RESOLVEUPDATE
OFcolumn-name ON table-name
[REFERENCING [OLDAS old_val]
[NEWAS new_val]
[REMOTEAS remote_val ] ]
FOREACH ROW
BEGIN
.. .
END
RESOLVEUPDATEtriggers fire before each row is updated. The
REFERENCINGclause allows access to the values in the row of the table to
beupdated (OLD), to the values the row is to be updated to (NEW) and to
therows that should be present according to the VERIFY clause (REMOTE).
Onlycolumns present in the VERIFY clause can be referenced in the
REMOTEAS clause; other columns produce a “column not found” error.
Usingthe VERIFY_ALL_
COLUMNSoption Thedatabase option VERIFY_ALL_COLUMNS is OFF by default. Ifit is
setto ON, all columns are verified on replicated updates, and a RESOLVE
UPDATEtrigger is fired whenever any column is different. If it is set to
OFF,only those columns that are updated are checked.
Settingthis option to ON makes messages bigger, because more information
issent for each UPDATE.
Ifthis option is set at the consolidated database before remote databases are
extracted,it will be set at the remote databases also.
Youcan set the VERIFY_ALL_COLUMNS option either for the PUBLIC
123