Mapping cast functions: CastFuncMapper element
The CastFuncMapper element is used for customizing the mappings of the cast functions listed in Table 11-17. The Integration service generates the default templates for the cast functions.
<INTEGER>, <INTEGER>, <INTEGER>
<DECIMAL>, <INTEGER>, <INTEGER>
<DOUBLE>, <INTEGER>, <INTEGER>
<VARCHAR>, <INTEGER>, <INTEGER>
The second and third operands are the decimal precision and scale, for example 20 and 8 in CAST (AS DECIMAL (20, 8)). Specify the default precision and scale using the iServer configuration variables DefaultDecimalPrecision and DefaultDecimalScale.
<INTEGER>, <INTEGER>
<DECIMAL>, <INTEGER>
<DOUBLE>, <INTEGER>
<VARCHAR>, <INTEGER>
<TIMESTAMP>, <INTEGER>
The second operand is the string length, for example 50 in CAST(AS VARCHAR (50)). Specify the default string length using the iServer configuration variable DefaultStringLength.
Example: Mapping the CAST functions
The default templates generated by the Integration service are not compatible with your database, so you change the mappings to use the CONVERT function. $R represents the return data type:
<CastFuncMapper>
  <FunctionMappings>
    <FunctionMapping FunctionName="CAST_AS_INTEGER">
      CONVERT ($R, $P0)
    </FunctionMapping>
    <FunctionMapping FunctionName="CAST_AS_DECIMAL">
      CONVERT ($R, $P0)
    </FunctionMapping>
    <FunctionMapping FunctionName="CAST_AS_DOUBLE">
      CONVERT ($R, $P0)
    </FunctionMapping>
    <FunctionMapping FunctionName="CAST_AS_VARCHAR">
      CONVERT ($R, $P0)
    </FunctionMapping>
    <FunctionMapping FunctionName="CAST_AS_TIMESTAMP">
      CONVERT ($R, $P0)
    </FunctionMapping>
  </FunctionMappings>
</CastFuncMapper>

Additional Links:

Copyright Actuate Corporation 2012