User's Manual
Chapter 6. Principles of SQL Remote Design
UPDATE statement may differ from the entered UPDATE statement.
UPDATE statements
replicated as INSERTS
or DELETES
If an UPDATE statement has the effect of removing a row from a given
remote user’s subscription, it is sent to that user as a DELETE statement. If
an UPDATE statement has the effect of adding a row to a given remote
user’s subscription, it is sent to that user as an INSERT statement.
The figure illustrates a publication, where each subscriber subscribes by
their name:
Consolidated
ID Rep
Ann
2
1
Marc
Dept
101
101
3
Ann
101
Ann
ID Rep
1 Ann
3 Ann
>
Marc
ID Rep
2 Marc
3 Marc
Marc
ID Rep
2
Marc
3
Marc
Ann
ID Rep
1
Ann
Consolidated
ID Rep
Ann
2
1
Marc
Dept
101
101
3 Marc 101
An UPDATE that changes the Rep value of a row from Marc to Ann is
replicated to Marc as a DELETE statement, and to Ann as an INSERT
statement.
This reassignment of rows among subscribers is sometimes called territory
realignment, because it is a common feature of sales force automation
applications, where customers are periodically reassigned among
representatives.
UPDATE conflict
detection
An UPDATE statement changes the value of one or more rows from some
existing value to a new value. The rows altered depend on the WHERE
clause of the UPDATE statement.
When SQL Remote replicates an UPDATE statement, it does so as a set of
single-row updates. These single-row statements can fail for one of the
following reasons:
♦ The row to be updated does not exist Each row is identified by its
primary key values, and if a primary key has been altered by some other
user, the row to be updated is not found.
79