Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

You can create a PL/SQL function to handle a particular conflict. This is useful when there are specific business rules that describe the behavior when there is a conflict. With PL/SQL different conflict handlers can be created that are not handled by the supplied conflict handlers. For example the DELTA conflict handler which adds up the different updated values from both source and target can be programmed using PL/SQL.

The following is an example of the command set 'nodata_update_avi' function to be executed when there s is 'NO_DATA' conflict raised by Dbvisit Replicate for update operation on scott.avi table.

Section
Column
width5%

 

Column
width95
Panel
bgColorCCC
SET_CONFLICT_HANDLERS FOR TABLE scott.avi FOR UPDATE ON NO_DATA 
TO PLSQL scott.dbvisit.nodata_update_avi

...

Section
Column
width5%

 

Column
width95
Panel
bgColorCCC
function_name(apply_old_data table%rowtype, has_found_apply_row boolean, 
primary_key_data table%rowtype, new_data table%rowtype) return number;
Info

Here,The following applies:

apply_old_data : the values at the target, queried by using key columns in the where clause. The boolean flag indicates whether any such record was found.

primary_key_data: old values at the source; mostly used to see the key, but it actually contains all supplementally logged values, too. Thus it will always (excl. LOBs, LONGs) include the modified column, too.

new_data: new (modified) values at the source.

...