Mapping numeric functions: NumericFuncMapper element
The NumericFuncMapper element is used for customizing the mappings of the numeric functions listed in Table 10‑6. The table also shows the default template for each function.
Table 10‑6 Default templates for mapping numeric functions
Numeric function
Operand data types
Default template
ROUND
<DECIMAL>, <INTEGER>
<DOUBLE>, <INTEGER>
{FN ROUND ($P0, $P1)}
FLOOR
<DECIMAL>
<DOUBLE>
{FN FLOOR ($P0)}
CEILING
<DECIMAL>
<DOUBLE>
{FN CEILING ($P0)}
POWER
<INTEGER>, <INTEGER>
{FN POWER ($P0, $P1)}
<DECIMAL>, <INTEGER>
Generated by the Integration service
<DOUBLE>, <INTEGER>
{FN POWER ($P0, $P1)}
MOD
<INTEGER>, <INTEGER>
{FN MOD ($P0, $P1)}
Example: Mapping the POWER function
The POWER function with DECIMAL and INTEGER operands does not give accurate results on your database. To obtain more accurate results, you convert the second operand to a decimal:
<NumericFuncMapper>
<FunctionMappings>
<FunctionMapping FunctionName="POWER"
OperandTypes="DECIMAL INTEGER">
POWER ($P0, CAST ($P1 AS DECIMAL (10, 0))
</FunctionMapping>
</FunctionMappings>
</NumericFuncMapper>