Functions Node
This section covers the following topics:
About Functions
A function is a named set of PL/SQL statements designed to accept and return data values; the returned value is based on the values a user inputs. Functions are either built-in or user-defined PL/SQL expressions. The functions represented by the Function node are user-defined expressions, for example:
circle_area(radius) payroll.tax_rate(empno) hr.employees.comm_pct(dependents, empno)@remote DBMS_LOB.getlength(column_name) my_function(DISTINCT a_column)
If you prefer to write a function that does not return any values, consider writing a procedure.
How the Functions Node Works
A Function node is a child of the Functions node. Each of these child Function nodes has a set of child parameter nodes. To perform actions on this node: right-click the node and from the menu, choose the appropriate command. To view the node's properties, select the node and/or click Properties in the node's menu.
The Functions node contains one or more child Function nodes to represent a function schema object in the Oracle database. Each of the Function Nodes has a set of parameter nodes and a return value node.
To perform actions on the Functions node, right-click on the node and in the menu, choose the appropriate command. To view the node's properties, select Properties from the menu.
If this collection node is filtered, the icon changes to include a funnel symbol. For more information about filtering, see Filtering Collection Nodes.
Menu Options
Menu Option | Description |
---|---|
New PL/SQL Function |
Creates a new PL/SQL function using the Function Designer. |
New .NET Function |
Deploys the function to an Oracle database as a .NET Assembly using the Oracle Deployment Wizard for .NET. Only visible users with |
Query Window |
Opens the Query Window so that you can execute SQL and PL/SQL queries from Visual Studio. |
Generate Create Script |
Writes the function definitions to a If the object associated with the functions node is deleted from the database backend, this menu option does the following: Displays a message indicating that this object no longer exists in Oracle Database, and the script will not be generated. |
Generate Create Script to Project |
Generates the function definitions to a . If multiple objects in Server Explorer are selected, a master SQL script is created in the Oracle Database Project Scripts folder. This master script contains calls to individual child SQL scripts (one for each schema object) generated into the various schema object folders and this master script is ordered with dependencies taken into consideration. If there are multiple open Oracle Database projects, Visual Studio prompts you to select the project to add the script to. This operation can also be performed by dragging and dropping the Server Explorer node(s) directly onto a database project folder. See Managing Oracle Script Files for more information. Note: Oracle Database Project Version 2 projects are not supported. To add scripts to this project type, use Import Schema or Add Existing Item menu items on an Oracle Database Project Version 2 project folder, or use the Schema Compare tool. |
Filters |
Opens the Filters Tab to control which child nodes appear under the collection. |
Privileges |
Opens the Grant/Revoke Privileges dialog box. |
Refresh |
Updates the Functions node tree, including its associated function and parameter nodes. |
Properties |
Displays the Properties window. |