Function Designer
The Function Designer lets you create new functions. This section covers the following topics:
Creating Functions in Oracle Developer Tools
Use the Function Designer to create the template code for a new standalone function. After you create the function template, the PL/SQL Code Editor opens with the function code displayed so that you can customize the function as needed.
If you want to edit an existing function, in Server Explorer, double-click the node that represents the function or right-click the node and click Edit. Then edit the function code in the PL/SQL Code Editor.
If you want to create a function and add it to a package, consider using the Package Designer to create the function.
Once you have completed the function, you can compile and run it by right-clicking its function node in Server Explorer and choosing from the menu that appears. To delete the function, right-click its node and from the menu, select Delete.
Note: If you want to create a SQLJ, C, or Java call specification, or a pragma clause, use the PL/SQL Code Editor.
Starting the Function Designer
In Server Explorer, right-click the Functions node and from the menu, select New PL/SQL Function.
The Function Designer appears similar to the following:
Using the Function Designer
In general, use the Function Designer to create a template for the function. The template contains parameters for the base definition of the function, but not more elaborate code such as statements to add within the template's BEGIN
and END
statements. After you create this template, you can customize it in the PL/SQL Code Editor.
The controls in the Function Designer are as follows:
Control | Description |
---|---|
Schema name |
Select from the list of available schemas in which to create the function. |
Function name |
Enter a name for the function. |
Return type |
Select from the choices of data types listed. If the data type is not listed, you can type it in the Return type box. |
Authentication identifier |
Select from the following choices:
|
Use pipelining to return rows |
Returns the results of a table function iteratively. |
Parameters |
Lists the parameters and their data types used in this function. To create a new parameter, click Add, and then use the Parameter Details pane to modify the parameter as needed. As you create parameters, their PL/SQL code appears in the SQL Preview box. To modify the order of parameters, select the parameter to move and click the Up or Down arrow. To remove a parameter, select it and click Remove. |
Parameters detail |
Displays detailed information about the selected parameter:
|
Preview SQL |
Displays the |
OK |
Saves your work, creates the function with the template code in the database, and displays the function template code in the PL/SQL Code Editor so that you can customize it. To commit the changes to the new function template, click the Save button in the Visual Studio .NET toolbar or select Save from the File menu. If you have created the function with errors, Oracle Developer Tools displays an error dialog box, and then displays the error messages in the Output window. Click OK and correct the error in the Function Designer. Afterwards, when you click the designer's OK button to save your changes, click Yes to replace the incorrect function with the corrected version. After you successfully create the function, Oracle Developer Tools displays its node in Server Explorer. |
See Also