Book Image

Oracle Goldengate 12c Implementers Guide

By : John P Jeffries
Book Image

Oracle Goldengate 12c Implementers Guide

By: John P Jeffries

Overview of this book

The book is aimed at Oracle database administrators, project managers, and solution architects who wish to extend their knowledge of GoldenGate. The reader is assumed to be familiar with Oracle databases. No knowledge of GoldenGate is required.
Table of Contents (16 chapters)
12
A. GGSCI Commands
13
B. GoldenGate Installed Components
14
C. Acronyms
15
Index

Using logic in the data replication


GoldenGate has a number of functions that enable the administrator to program logic in the Extract and Replicat process configuration. These provide generic functions found in the IF and CASE programming languages. In addition, the @COLTEST function enables conditional calculations by testing for one or more column conditions. This is typically used with the @IF function, as shown in the following code:

MAP SRC.CREDITCARD_PAYMENTS, TARGET TGT.CREDITCARD_PAYMENTS_FACT, &
COLMAP (USEDEFAULTS, &
AMOUNT = @IF(@COLTEST(AMOUNT, MISSING, INVALID), 0, AMOUNT));

Here, the @COLTEST function tests the AMOUNT column in the source data to check whether it is MISSING or INVALID. The @IF function returns 0 if @COLTEST returns TRUE and returns the value of AMOUNT if FALSE.

The target AMOUNT column is therefore set to 0 when the equivalent source is found to be missing or invalid; otherwise, a direct mapping occurs.

The @CASE function tests a list of values for a match...