Error Handling

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

Table 10-7 UPDATEROWEXISTS with USEDELTA and USEMAX

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 is the before image 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.

Target database image

name='Mary'
phone='1234567890'
address='Oracle Pkwy'
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.

salary=600 is the current image of the target column for the USEDELTA resolution.

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)'9/1/10 3:00'

This SQL returns a no-data-found error because the values for the salary and last_mod_time are different. (The values for comment and balance are also different, but these columns are not compared.)

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

SQL bind variables:

1)200
2)100
3)'Mary'

Per USEDELTA, the difference between the after image of salary (200) in the trail and the before image of salary (100) in the trail is added to the current value of salary in the target (600). The result is 700.

600 + (200 - 100) = 700

UPDATE applied by Replicat to resolve the conflict for the default columns, using USEMAX.

SQL bind variables:

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

Per USEMAX, because the after value of last_mod_time in the trail record is greater than the current value in the database, the row is 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.