oracle-golden-gate

Oracle Goldengate - IF statement - Not equal


@STREQ(INITIAL, 'F') will return TRUE if INITIAL column has value F

I want to check cases where INITIAL <> F


Solution

  • You can use the @IF function. For example:

    @IF(@STREQ(INITIAL, 'F'), 0, 1)
    

    From the documentation:

    The following compares the value of the region column to the literal value EAST. If region = EAST, the record passes the filter.

    FILTER (@STREQ (region, 'EAST'))
    

    You could use @STREQ in a comparison to determine a result, as shown in the following example. If the state is NY, the expression returns East Coast. Otherwise, it returns Other.

    @IF (@STREQ (state, 'NY'), 'East Coast', 'Other')