@COMPUTE

Use the @COMPUTE function to return the value of an arithmetic expression to a target column. The value returned from the function is in the form of a string.

You can omit the @COMPUTE phrase when returning the value of an arithmetic expression to another Oracle GoldenGate function, as in:

@STRNUM ((AMOUNT1 + AMOUNT2), LEFT)

The preceding returns the same result as:

@STRNUM ((@COMPUTE (AMOUNT1 + AMOUNT2), LEFT)

Arithmetic expressions can be combinations of the following elements.

Syntax

@COMPUTE (expression)

expression

A valid arithmetic expression. The numeric value plus the precision cannot be greater than 17 digits. If this limit is exceeded, @COMPUTE returns an error similar to the following.

2013-08-01 01:54:22  ERROR   OGG-01334  Error mapping data from column to column in function COMPUTE.

Examples

Example 1

AMOUNT_TOTAL = @COMPUTE (AMT + AMT2)

Example 2

AMOUNT_TOTAL = @IF (AMT >= 0, AMT * 100, 0)

Example 3

ANNUAL_SALARY = @COMPUTE (MONTHLY_SALARY * 12)

mod(id,10) = 1 MAP otest.tab,TARGET mtest.tab1,FILTER (@compute (id \ 10) = 1)

This example illustrates how to achieve the remainder SQL. Ensure that there is a space between id \ 10 in the three characters, otherwise it will be reported as a filter syntax error.