Creating user-defined functions from the Data Source Explorer or Administration Explorer

You can create user-defined functions from the Data Source Explorer or Administration Explorer.

About this task

Using the User-Defined Function wizard, you can create a user-defined function based on a template, then modify the code in the routine editor as needed. This method is useful if you want to quickly create a user-defined function and run it on the server.

Procedure

To create a user-defined function from the Data Source Explorer or Administration Explorer:

  1. In the explorer view, right-click the User-Defined Functions folder and click New User-Defined Function.
    • In the Data Source Explorer, a User-Defined Functions folder is in each schema of the Schemas folder.
    • In the Administration Explorer, the User-Defined Functions folder is in the Application Object folder.

    The New User-Defined Function wizard opens.
  2. Complete the steps of the wizard.

    After you specify a name and language, select a template to use as the starting point for your user-defined function.

Results

The user-defined function opens in the routine editor.

What to do next

Modify the sample user-defined function code as needed. Deploy the user-defined function to your database and run the user-defined function.

You can save the user-defined function as a file on your computer. The saved file contains the source code and property information from the database.

You open the saved file from the workbench by selecting File > Open File. When you open the file, you specify database connection information. The connection information is used when you deploy and run the user-defined function.


Feedback