Mapping NULL functions: NullFuncMapper element
The NullFuncMapper element is used for customizing the mappings of the NULL functions listed in Table 10‑13. The table also shows the default template for each function.
Table 10‑13 Default templates for mapping NULL functions
NULL function
Operand data types
FunctionName
Default template
IS NULL
<INTEGER>
<DECIMAL>
<DOUBLE>
<VARCHAR>
<TIMESTAMP>
Use IS_NULL as FunctionName for IS NULL.
$P0 IS NULL
CAST (NULL AS INTEGER)
 
Use CAST_NULL_AS_INTEGER as FunctionName.
Generated by the Integration service
CAST (NULL AS DECIMAL)
 
Use CAST_NULL_AS_DECIMAL as FunctionName.
CAST (NULL AS DOUBLE)
 
Use CAST_NULL_AS_DOUBLE as FunctionName.
CAST (NULL AS VARCHAR)
 
Use CAST_NULL_AS_VARCHAR as FunctionName.
CAST (NULL AS TIMESTAMP)
 
Use CAST_NULL_AS_TIMESTAMP as FunctionName.
Example: Disabling the CAST (NULL AS . . .) functions
Your database does not support the NULL literal, so the CAST (NULL AS . . .) functions must be disabled:
<NullFuncMapper>
<FunctionMappings>
<FunctionMapping FunctionName="CAST_NULL_AS_INTEGER"
Disabled="true" />
<FunctionMapping FunctionName="CAST_NULL_AS_DECIMAL"
Disabled="true" />
<FunctionMapping FunctionName="CAST_NULL_AS_DOUBLE"
Disabled="true" />
<FunctionMapping FunctionName="CAST_NULL_AS_VARCHAR"
Disabled="true" />
<FunctionMapping FunctionName="CAST_NULL_AS_TIMESTAMP"
Disabled="true" />
</FunctionMappings>
</NullFuncMapper>
Mapping conditional functions: CondFuncMapper element
The CondFuncMapper element has attributes that you use to customize CASE statements. These attributes are listed in Table 10‑14.
Table 10‑14 Attributes of the CondFuncMapper element
Attribute name
Description
Required?
CaseWhenString
String to use instead of CASE WHEN
No. Default is CASE WHEN.
WhenString
String to use instead of WHEN
No. Default is WHEN.
ThenString
String to use instead of THEN
No. Default is THEN.
ElseString
String to use instead of ELSE
No. Default is ELSE.
EndString
String to use instead of END
No. Default is END.
Example: Mapping the CASE statement
Your database uses a SWITCH statement instead of a CASE statement. SWITCH is not standard SQL. The Actuate SQL CASE prototype is as follows:
CASE [<ValueExpression>]
{<WhenClause>} […n]
[ELSE <ValueExpression>]
END
The mapping for SWITCH is as follows:
<CondFuncMapper CaseWhenString="SWITCH ("
WhenString=","
ThenString=","
ElseString=", TRUE,"
EndString=")" />
This mapping produces a SWITCH statement such as:
SWITCH (
Country IN ('Canada', 'Mexico', 'USA'), 'North America',
Country IN ('Argentina', 'Brazil', 'Venezuela'),
'South America',
Country IS NULL, '(Not Known)',
TRUE, 'Rest of the world')