User's Manual
Chapter 7. SQL Remote Design for Adaptive Server Anywhere
A special UPDATE
statement for
publications
The UPDATE statement in this trigger is of the following special form:
UPDATE table-name
PUBLICATION publication-name
{ SUBSCRIBE BY subscription-expression |
OLD SUBSCRIBE BY old-subscription-expression
NEW SUBSCRIBE BY new-subscription-expression }
WHERE search-condition
♦ Here is what the UPDATE statement clauses mean:
♦ The
table-name
indicates the table that must be modified at the remote
databases.
♦ The
publication-name
indicates the publication for which subscriptions
must be changed.
♦ The value of
subscription-expression
is used by the Message Agent to
determine both new and existing recipients of the rows. Alternatively,
you can provide both OLD and NEW subscription expressions.
♦ The WHERE clause specifies which rows are to be transferred between
subscribed databases.
Notes on the trigger ♦ If the trigger uses the following syntax:
UPDATE table-name
PUBLICATION pub-name
SUBSCRIBE BY sub-expression
WHERE search-condition
the trigger must be a BEFORE trigger. In this case, a BEFORE UPDATE
trigger. In other contexts, BEFORE DELETE and BEFORE INSERT are
necessary.
♦ If the 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
The trigger can be a BEFORE or AFTER trigger.
♦ The UPDATE statement lists the publication and table that is affected.
The WHERE clause in the statement describes the rows that are affected.
No changes are made to the data in the table itself by this UPDATE, it
makes entries in the transaction log.
109