If you clicked the Browse button, in the Native Sequence Choice dialog, select a

Working with Procedures, Variables, Sequences, and User Functions 12-25 ■ ... A user function can be used directly by specifying its syntax, for example: NullValueCITY_NAME, No City User functions are implemented in one or more technologies. For example, the Oracle nvlVARIABLE,DEFAULT_VALUE, function - which returns the value of VARIABLE, or DEFAULT_VALUE if VARIABLE is null - has no equivalent in all technologies and must be replaced by the formula: case when VARIABLE is null then DEFAULT_VALUE else VARIABLE end With user functions, it is possible to declare a function called NullValueVARIABLE,DEFAULT_VALUE and to define two implementations for the syntax above. When executing, depending on the technology on which the order will be executed, the NullValue function will be replaced by one syntax or the other. The next example illustrates how to implement a user function that would be translated into code for different technologies: Suppose you want to define a function that, given a date, gives you the name of the month. You want this function to be available for your mappings when executed on Oracle, Teradata or Microsoft SQL Server. Table 12–8 shows how to implement this as a user function. You can now use this function safely in your interfaces for building your mappings, filters and joins. Oracle Data Integrator will generate the appropriate code depending on the execution location of your expression. Another example of a user function translated into code for different technologies is defining the following mapping: Table 12–8 User Function Translated into Code for Different Technologies Example 1 Function Name GET_MONTH_NAME Function Syntax GET_MONTH_NAMEdate_input Description Retrieves the month name from a date provided as date_input Implementation for Oracle Initcapto_chardate_input, MONTH Implementation for Teradata case when extractmonth from date_input = 1 then ‘January’ when extractmonth from date_input = 2 then ‘February’ when extractmonth from date_input = 3 then ‘March’ when extractmonth from date_input = 4 then ‘April’ when extractmonth from date_input = 5 then ‘May’ when extractmonth from date_input = 6 then ‘June’ when extractmonth from date_input = 7 then ‘July’ when extractmonth from date_input = 8 then ‘August’ when extractmonth from date_input = 9 then ‘September’ when extractmonth from date_input = 10 then ‘October’ when extractmonth from date_input = 11 then ‘November’ when extractmonth from date_input = 12 then ‘December’ end Implementation for Microsoft SQL datenamemonth, date_input