Creating non-PL/SQL user-defined functions from the Data Source Explorer

You can use SQL and XQuery editor or the Routine Editor to create non-PL/SQL user-defined functions.
About this task

Using the SQL and XQuery Editor, you can create a non-PL/SQL user-defined function based on a template, and modify the template as needed. This method is useful if you want to quickly create a user-defined function and run it on the server.

Using the Routine Editor, you can specify the name and language for a user-defined function and then open the source code in the Routine editor for further modification. When you create a user-defined function using this method, you must specify a data development project to store the source code for the user-defined function. You can specify an existing project that is associated with the connection you are working in, or you can create a new project.

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

  1. Switch to the Data perspective.
  2. In the Data Source Explorer, right-click the User-Defined Functions folder under a database connection, and click one of the following menu items:
    • Click New > With SQL and XQuery editorto open a user-defined function template in the SQL and XQuery editor.
    • Click New > With Routine Editor to open a window so that you can specify a name, language, and data development project for the user-defined function, then click Finish.
    If you use the SQL and XQuery editor, you can modify the template and run the user-defined function from the SQL and XQuery editor view to deploy the user-defined function to the database. If you use the Routine Editor, the user-defined function is added to the User-Defined Functions folder in the data development project that you specified, and the user-defined function opens in the routine editor.

Feedback