In Designer Navigator select the Sequences node in a project or the Global

Working with Procedures, Variables, Sequences, and User Functions 12-23 2. If you are using incremental update IKMs, make sure that the update key in use does not contain the identity column. If the identity column is part of the primary key, you should define an alternate key as the update key for the interface. Limitations of Identity Columns Identity columns have the following limitations: ■ Not null cannot be checked for an identity column. ■ Static and flow control cannot be performed on a primary or alternate key containing the identity column.

12.4 Working with User Functions

This section provides an introduction to user functions and describes how to create and use user functions in Oracle Data Integrator.

12.4.1 Introduction User Functions

User functions are used for defining customized functions that can be used in interfaces or procedures. It is recommended to use them in your projects when the same complex transformation pattern needs to be assigned to different datastores within different interfaces. User functions improve code sharing and reusability and facilitate the maintenance and the portability of your developments across different target platforms. User functions are implemented in one or more technologies and can be used anywhere in mappings, joins, filters and conditions. Refer to Section 12.4.3, Using User Functions . A function can be created as a global function or in a project. In the first case, it is common to all projects, and in the second, it is attached to the project in which it is defined. User functions can call other user functions. A user function cannot call itself recursively. The following sections describe how to create and use user functions.

12.4.2 Creating User Functions

To create a user function:

1. In Designer Navigator select the User Functions node in a project or the Global

User Functions node in the Others view. 2. Right-click and select New User Function. The User Function Editor opens. 3. Fill in the following fields: ■ Name : Name of the user function, for example NullValue Note: Aggregate functions are not supported User Functions. The aggregate function code will be created, but the GROUP BY expression will not be generated. 12-24 Oracle Fusion Middleware Developers Guide for Oracle Data Integrator ■ Group : Group of the user function. If you type a group name that does not exist, a new group will be created with this group name when the function is saved. ■ Syntax : Syntax of the user function that will appear in the expression Editor; The arguments of the function must be specified in this syntax, for example NullValuevariable, default

4. From the File menu, click Save.

The function appears in the Projects or Others tree in Designer Navigator. Since it has no implementation, it is unusable. To create an implementation: 1. In Designer Navigator double-click the User Function for which you want to create the implementation. The User Function Editor opens.

2. In the Implementations tab of the User Function Editor, click Add

Implementation . The Implementation dialog opens.

3. In the Implementation syntax field, type the code of the implementation, for

example nvlvariable, default 4. Check the boxes for the implementations Linked technologies

5. Check Automatically include new technologies if you want the new technologies

to use this syntax.

6. Click OK.

7. From the File menu, click Save.

To change an implementation:

1. In the Implementations tab of the User Function Editor, select an implementation,

then click Edit.

2. In the Implementations tab of the user function, select an implementation, then

click Edit Implementation. The Implementation dialog opens. 3. Change the Implementation syntax and the Linked technologies of this implementation

4. Check Automatically include new technologies if you want the new technologies

to use this syntax.

5. Click OK.

6. From the File menu, click Save.

To remove an implementation: In the implementations tab of the user function, select an implementation, then click Delete Implementation .

12.4.3 Using User Functions

The user functions can be used in all Oracle Data Integrator expressions: ■ Mappings, ■ Filters, ■ Joins, ■ Constraints,