Table of Contents

Search

  1. Preface
  2. Scripting Overview
  3. Tcl Scripting
  4. SQL Scripting

Handling Undo and Redo Values in Merge Apply Processing

Handling Undo and Redo Values in Merge Apply Processing

For Merge Apply processing of deletes and updates, you need to process both undo and redo records. You create an expression that checks for the existence of redo data for the appropriate change record and extracts the undo value if the redo data does not exist.
The following example expression sets the redo and undo values of the VIRT virtual column to the result of the some_proc procedure:
proc get_merged_value { in_c } { if { [ ::dbs::has_redo $in_c ] } { return [ ::dbs::get_redo $in_c ] } else { return [ ::dbs::get_undo $in_c ] } } proc get_undo_only { in_c } { if { [ ::dbs::has_undo $in_c ] } { return [ ::dbs::get_undo $in_c ] } else { return 0 } } proc some_proc { value } { return “$value – is processed ” } ::dbs::set_redo VIRT [ some_proc [ get_merged_value $CALL_DATE ]] ::dbs::set_undo VIRT [ some_proc [ get_undo_only $CALL_DATE]]
This example populates the undo value of the virtual column by using the undo value of the input column.

0 COMMENTS

We’d like to hear from you!