UPDATEROWMISSING with OVERWRITE Resolution

For this example, the OVERWRITE resolution is illustrated with the applicable before and after images for the record in the trail and in the database. It shows how to resolve the case where the target row is missing. The logical resolution, and the one used, is to overwrite the row into the target so that both databases are in sync again.

Table 10-4 UPDATEROWMISSING Conflict with OVERWRITE Resolution

Image SQL Comments

Before image in trail

name='Jane'
phone='333'
address='Oracle Pkwy'
salary=200
balance=200
comment=NULL
last_mod_time='9/1/10 7:00'

N/A

After image in trail

phone='4444'
address='Holly'
last_mod_time='9/1/10 8:00'

Target database image

None (row for Jane is missing)

Initial UPDATE applied by Replicat that detects the conflict

SQL bind variables:

1)'4444'
2)'Holly'
3)'9/1/10 8:00'
4)'Jane'
5)'333'
6)'Oracle Pkwy'
7)200
8)200
9)NULL
10)'9/1/10 7:00'

This SQL returns a no-data-found error. All columns are used in the WHERE clause because the COMPARECOLS statement is set to ALL.

INSERT applied by Replicat to resolve the conflict

SQL bind variables:

1)'Jane'
2)'4444'
3)'Holly'
4)200
5)200
6)NULL
7)'9/1/10 8:00'

The update is converted to an insert because OVERWRITE is the resolution. The after image of a column is used if available; otherwise the before image is used.