Mapping arithmetic operators: ArithOpMapper element
The ArithOpMapper element is used for customizing the mappings of the arithmetic operators listed in Table 10‑5. The table also shows the default template for each operator.
Table 10‑5 Default templates for mapping arithmetic operators
Arithmetic operator
Operand data types
Default template
Remarks
+
<INTEGER>, <INTEGER>
<DOUBLE>, <DOUBLE>
<DECIMAL>, <DECIMAL>
($P0 + $P1)
Use ADD as the FunctionName for +.
-
($P0 - $P1)
Use SUB as the FunctionName for ‑.
*
($P0 * $P1)
Use MULT as the FunctionName for *.
/
<INTEGER>, <INTEGER>
($P0 / $P1)
Use DIV as the FunctionName for /.
<DOUBLE>, <DOUBLE>
($P0 / $P1)
<DECIMAL>, <DECIMAL>
Generated by the Integration service
-
<INTEGER>
<DOUBLE>
<DECIMAL>
- ($P0)
Use NEG as the FunctionName for ‑.
Example: Mapping the negation operator
You change the mapping of the negation operator because your database uses a different syntax. You use NEG as the FunctionName:
<ArithOpMapper>
<FunctionMappings>
<FunctionMapping FunctionName="NEG">
NEGATE ($P0)
</FunctionMapping>
</FunctionMappings>
</ArithOpMapper>