Table of Contents

Search

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

Access to REDO Values

:NEW.
<column_name>
Returns the REDO value of the
<column_name>
column in a source table.
The SQL Script Engine binds fixed-point number datatypes as text. If you perform arithmetic operations on REDO values that have number datatypes in the SQL expression, ensure that the syntax of the target database allows these operations on numbers that are represented as text. If the syntax of the target database requires numeric operands, convert the REDO values to the appropriate number datatypes in the SQL expression. For example, for a SQL Server target, use the following syntax to multiply two integers:
convert(int, :NEW.COLUMN1) * convert(int, :NEW.COLUMN2)
:NEW.
<column_name>
.is_available
For Applier processing in SQL Apply mode, returns 1 if the
<column_name>
column in a source table has the REDO value. Returns 0 if the
<column_name>
column in a source table has no REDO value.
For Applier processing in Merge Apply and Audit Apply modes, returns 1 if the value of the
<column_name>
_NEW column in the audit log table is not a null value. Returns 0 if the
<column_name>
_NEW column has a null value.
The
<column_name>
_NEW columns in audit log tables contain null values in the following cases:
  • The source column has a null value.
  • For Oracle sources, the source row is updated but the specified source column is not changed, and the column is not included into a supplemental log group.
  • The source row is deleted.
For InitialSync processing, returns a null value.
:NEW.
<column_name>
.is_null
For Applier processing in SQL Apply mode, returns 1 if the REDO value of the
<column_name>
column in a source table is a null value. Returns 0 if the REDO value of the
<column_name>
column in a source table is not a null value.
For Applier processing in Merge Apply and Audit Apply modes, returns 1 if the
<column_name>
_NEW column in the audit log table contains a null value. Returns 0 if the
<column_name>
_NEW column is not a null value.
If the source column has no REDO value, the :NEW.
<column_name>
.is_null operator returns 1. In SQL Apply mode, you can use the :NEW.
<column_name>
.is_available operator to determine if the source column has a REDO value. To do so, enter the :NEW.
<column_name>
.is_available operator before the :NEW.
<column_name>
.is_null operator in the script.
The following SQL expression determines whether the COL3 column has a REDO or UNDO value and then compares this value to the null value:
CASE WHEN :NEW."COL3".IS_AVAILABLE = 1 THEN :NEW."COL3".IS_NULL WHEN :OLD."COL3".IS_AVAILABLE = 1 THEN :OLD."COL3".IS_NULL ELSE
not_in_supplemental_group
END
If the column has neither a REDO nor UNDO value, the expression returns the
not_in_supplemental_group
value.
For InitialSync processing, returns a null value.
:NEW.
<column_name>
.type
Returns a VARCHAR string that contains the datatype of the
<column_name>
column in the source table.

0 COMMENTS

We’d like to hear from you!