6.80 HANDLETPKUPDATE

Valid For

Replicat (nonintegrated mode)

Description

Use the HANDLETPKUPDATE parameter to prevent constraint errors when an update to a primary key results in a transient duplicate. This is an Oracle parameter for nonintegrated Replicat and is required if the target database is any version earlier than Oracle version 11.2.0.2. For target Oracle databases that are version 11.2.0.2 or later, transient primary-key duplicates are handled automatically without requiring HANDLETPKUPDATE. Integrated Replicat handles this issue automatically so it is not necessary to set this parameter

A transient primary-key duplicate occurs when an update affects the primary keys of multiple rows in a transaction. This kind of statement typically uses a SET x = x+n formula or other manipulation that shifts the values so that a new value is the same as an existing one.

The following example illustrates a sequence of value changes that can cause this condition. The example assumes table ITEM where the primary key column is named CODE and the current key values for the rows in the table are 1, 2, and 3.

update item set code = 2 where code = 1;
update item set code = 3 where code = 2;
update item set code = 4 where code = 3;

In this example, when the first UPDATE is applied to the target, there is an error because the primary key value of 2 already exists in the target. The target transaction returns constraint violation errors. By default, Replicat does not detect or handle these violations and abends.

When using HANDLETPKUPDATE, create the constraints as DEFERRABLE INITIALLY IMMEDIATE on the target tables. If the target constraints cannot be DEFERRABLE, Replicat handles the errors according to existing rules specified with the HANDLECOLLISIONS and REPERROR parameters, or else it abends.

This parameter can be used in a parameter file, and it can be used within a MAP statement as follows:

MAP ggs.equip_account, TARGET ggs.equip_account, HANDLETPKUPDATE; 

Default

Abend on transient primary key updates

Syntax

HANDLETPKUPDATE