• 3.OGG函数


    1.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)

    和下面的得到的结果是一致的

    @STRNUM ((@COMPUTE (AMOUNT1 + AMOUNT2), LEFT)
    Arithmetic expressions can be combinations of the following elements.
    ● Numbers
    ● The names of columns that contain numbers
    ● Functions that return numbers
    ● Arithmetic operators:
    + (plus)
    - (minus)
    * (multiply)
    / (divide)
    (remainder)
    ● Comparison operators:
    > (greater than)
    >= (greater than or equal)
    < (less than)
    <= (less than or equal)
    = (equal)
    <> (not equal)
    Results that are derived from comparisons can be zero (indicating FALSE) or non-zero (indicating TRUE).
    ● Parentheses (for grouping results in the expression)
    ● The conjunction operators AND, OR. Oracle GoldenGate only evaluates the necessary part of a conjunction expression. Once a statement is FALSE, the rest of the expression
    is ignored. This can be valuable when evaluating fields that may be missing or null.
    For example, if the value of COL1 is 25 and the value of COL2 is 10, then the following are possible:
    @COMPUTE (COL1 > 0 AND COL2 < 3) returns 0.
    @COMPUTE (COL1 < 0 AND COL2 < 3) returns 0. COL2 < 3 is never evaluated.
    @COMPUTE ((COL1 + COL2)/5) returns 7.

    Syntax @COMPUTE(<expression>)

    2.STRCAT

    连接一个或者多个字符串(字符串列),文字字符串放在引号内

    例如:

    Example The following creates a phone number from three columns and includes the literal
    formatting values.
    PHONE_NO = @STRCAT (AREA_CODE, PREFIX, “-”, PHONE)

     

  • 相关阅读:
    【树状数组套权值线段树】bzoj1901 Zju2112 Dynamic Rankings
    【权值线段树】bzoj3224 Tyvj 1728 普通平衡树
    【转载】【树形DP】【数学期望】Codeforces Round #362 (Div. 2) D.Puzzles
    ReStart
    Good-Bye
    【分块打表】bzoj1662 [Usaco2006 Nov]Round Numbers 圆环数
    【分块打表】bzoj1026 [SCOI2009]windy数
    【分块打表】bzoj3798 特殊的质数
    【分块打表】bzoj3758 数数
    【线段树】bzoj3995 [SDOI2015]道路修建
  • 原文地址:https://www.cnblogs.com/haoxiaoyu/p/4023378.html
Copyright © 2020-2023  润新知