Error Handling

For an example of error handling to an exceptions table, see Configuring the Oracle GoldenGate Parameter Files for Error Handling.

Table 9-15 UPDATEROWEXISTS with USEDELTA, USEMAX, and IGNORE

Image SQL Comments

Before image in trail

name='Mary'
phone='1234567890'
address='Oracle Pkwy'
salary=100
balance=100
comment=NULL
last_mod_time='9/1/10 3:00

last_mod_time='9/1/10 3:00 is the before image of the resolution column for the USEMAX resolution.

salary=100 and balance=100 are the before images for the USEDELTA resolution.

After image in trail

phone='222222'
address='Holly'
salary=200
comment='new'
last_mod_time='9/1/10 5:00'

last_mod_time='9/1/10 5:00 is the after image of the resolution column for USEMAX. Since there is an after image, this will be used to determine the resolution.

salary=200 is the only after image available for the USEDELTA resolution. For balance, the before image will be used in the calculation.

Target database image

name='Mary'
phone='1234567890'
address='Ralston'
salary=600
balance=600
comment='com'
last_mod_time='9/1/10 4:00'

last_mod_time='9/1/10 4:00 is the current image of the resolution column in the target against which the resolution column value in the trail is compared for USEMAX.

salary=600 and balance=600 are the current images of the target columns for USEDELTA.

Initial UPDATE applied by Replicat that detects the conflict

SQL bind variables:

1)'222222'
2)'Holly'
3)200
4)'new'
5)'9/1/10 5:00'
6)'Mary'
7)'1234567890'
8)'Oracle Pkwy'
9)100
10)100
11)'9/1/10 3:00'

This SQL returns a no-data-found error because the values for the address, salary, balance and last_mod_time columns are different.

UPDATE applied by Replicat to resolve the conflict for salary, using USEDELTA.

SQL bind variables:

1)200
2)100
3)'Mary'

For salary, there is a difference of 100, but there was no change in value for balance, so it is not needed in the update SQL. Per USEDELTA, the difference (delta) between the after (200) image and the before image (100) of salary in the trail is added to the current value of salary in the target (600). The result is 700.

UPDATE applied by Replicat to resolve the conflict for USEMAX.

SQL bind variables:

1)'Holly'
2)'9/1/10 5:00'
3)'Mary'
4)'9/1/10 5:00'

Because the after value of last_mod_time in the trail record is greater than the current value in the database, that column plus the address column are updated with the after values from the trail record.

Note that the salary column is not set here, because it is resolved with the UPDATE from the USEDELTA resolution.

UPDATE applied by Replicat for IGNORE.

SQL bind variables:

1)'222222'
2)'new'
3)'Mary'

IGNORE is specified for the DEFAULT column group (phone and comment), so no resolution SQL is applied.