Chapter 7. SQL Remote Design for AdaptiveSer verAnywhere
Aspecial UPDATE
statementfor
publications
TheUPDATE statement in this trigger is of the following special form:
UPDATEtable-name
PUBLICATIONpublication-name
{SUBSCRIBEBY subscription-expression|
OLDSUBSCRIBE BY old-subscription-expression
NEWSUBSCRIBE BY new-subscription-expression}
WHERE search-condition
Hereis what the UPDATE statement clauses mean:
The
table-name
indicatesthe table that must be modified at the remote
databases.
The
publication-name
indicatesthe publication for which subscriptions
mustbe changed.
Thevalue of
subscription-expression
isused by the Message Agent to
determineboth new and existing recipients of the rows. Alternatively,
youcan provide both OLD and NEW subscription expressions.
TheWHERE clause specifies which rows are to be transferred between
subscribeddatabases.
Noteson the tr igger Ifthe trigger uses the following syntax:
UPDATE table-name
PUBLICATION pub-name
SUBSCRIBE BY sub-expression
WHERE search-condition
thetrigger must be a BEFORE trigger. Inthis case, a BEFORE UPDATE
trigger. In other contexts,BEFORE DELETE and BEFORE INSERT are
necessary.
Ifthe trigger uses the alternate syntax:
UPDATE table-name
PUBLICATION publication-name
OLD SUBSCRIBE BY old-subscription-expression
NEW SUBSCRIBE BY new-subscription-expression }
WHERE search-condition
Thetrigger can be a BEFORE or AFTER trigger.
TheUPDATE statement lists the publication and table that is affected.
TheWHERE clause in the statement describes the rows that are affected.
Nochanges are made to the data in the table itself by this UPDATE, it
makesentries in the transaction log.
109