Creating a Function

Create a user-defined function in Data Integration to use expressions when creating data flows.

    1. Navigate to the workspace that contains the functions library in which you want to create and save a function.

      For the steps to access a workspace, see Accessing a Workspace.

    2. On the workspace home page, click User-defined functions.
    3. From the list of function libraries on the User-defined functions page, click the name of the library in which you want to create and save a function.
    4. In the Functions section of the library details page, click Create function.
    5. In the Create user defined function panel, enter the following details:
      • Name: Enter a name for the function.
      • Identifier: The identifier is a system-generated value based on the function name that you enter. You can change the value, but after you save the function, you can't update the identifier.
      • Description: Enter a description for the function.
      • Return data type: Select a data type from the list.
      • In library: The name of the library in which you're creating the function. To change the library, click Edit and select a library in the Edit library location dialog box.
    6. To use an input parameter in this function, first add the parameter as follows:
      1. In the Expression builder section, click Input parameters.

        If a parameter that you want to use is already added, it's listed under Input parameters. You can skip to step 7.

      2. From the Actions menu, click Add input parameters.
      3. In the Add input parameters panel, enter a name and description for the parameter that you want to add, and select a data type for it.
      4. To add another parameter, click Additional parameter and enter the parameter information. Repeat the procedure to add more parameters.
      5. When you have finished adding the parameters that you want to use in this function, click Add.

        The parameters are listed under Input parameters in the Expression builder section.

    7. In the Expression builder section, to create the expression for this function, double-click or drag an element from the Functions or Input parameters list to add the element to the editor. You can also manually write or edit the expression.
      1. On the Functions tab, expand the function category to find the function that you want to use.
      2. On the Input parameters tab, find the input parameters to build the expression. For example, for a function to calculate tax, you might have added input parameters for base salary (base), flexible benefits (flexi), and deductions (deductions). To build the expression, drag those input parameters to form the expression as base + flexi - deductions.
      3. To validate the expression, click Validate.
    8. Click Create.

      The user-defined function that you created is listed in the Functions section of the library details page.

  • Use the oci data-integration user-defined-function create command and required parameters to create a function:

    oci data-integration user-defined-function create [OPTIONS]

    For a complete list of flags and variable options for CLI commands, see the Command Line Reference.

  • Run the CreateUserDefinedFunction operation to create a function.