Package Nodes
This section covers the following topics:
How the Package Nodes Work
A Package node is a child of the Packages node. It represents a package schema object in the Oracle database. Each package node contains nodes for the following components within a package:
-
Functions: Represents any functions that you have added to the package, for example, after clicking Add to add methods in the Package Designer. Within each package function node, there can be child nodes representing parameters used for that function. The package function node also contains a child node representing the return value for that function.
-
Procedures: Represents any procedures that you have added to the package, similar to package functions. These too can have child nodes that represent the parameters used for that procedure.
-
Package body: Appears if you have specified a package body for the package.
A package with an error is indicated by a red x in the package icon.
A package that has been compiled with debug information have DBG embedded in the icon
To fix the error, open the package specification and/or package body code in the PL/SQL editor, make the required changes, and save the changes to the database. If the package has no errors, the red x disappears from the package icon.
To perform actions on the Package 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.
Menu Options
Menu Option | Description |
---|---|
Edit Package Specification |
Opens the package specification in the PL/SQL Code Editor. Only the package specification is present in the code window containing editable text starting with If the window already exists, Edit places the cursor at the start of the window. If the package database object associated with the node was deleted from the database, you will be asked if the node needs to be deleted from the Server Explorer. |
Edit Package Body |
Displays if the package has no package body. It opens the PL/SQL Code Editor containing editable text starting with If the window already exists, Add Package Body places the cursor at the start of the window. This menu item does not appear if the package does not have a package body. |
Add Package Body |
Displays if the package has no package body. It opens the PL/SQL Code Editor containing editable text starting with If the window already exists, Add Package Body places the cursor at the start of the window. This menu item will not appear if the package has a package body. |
Displays if the package has a package body. It opens the package body in the PL/SQL Code Editor. Only the package body is present in the code window containing editable text starting with If the window already exists, test places the cursor at the start of the window. This menu item will not appear if the package has no package body. If the database object associated with the node was deleted from the database, you will be asked if the node needs to be deleted from the Server Explorer. If the body of the package is |
|
Query Window |
Opens the Query Window so that you can execute SQL and PL/SQL queries from Visual Studio. |
Compile |
Performs the following actions:
Oracle Developer Tools automatically compiles a package and a package body when you save it. You only need to compile packages when you edit them. See PL/SQL Compiler Settings Options Page for compile settings. |
Compile Debug |
Compiles the package with debug information. This is required before PL/SQL code can be debugged. See Compiling a PL/SQL Program with Debug Information. See PL/SQL Compiler Settings Options Page for compile settings. |
Generate Create Script |
Writes the package definition to a |
Generate Create Script to Project |
Generates the package definition and adds it to the open Oracle Database Project. Generates the SQL script file definition 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. |
Dependencies and References |
Opens the Dependencies and References Viewer for viewing the dependencies that this object has on other database schema objects. |
Privileges |
Opens the Grant/Revoke Privileges dialog box. |
Delete |
Drops the package specification and package body. |
Refresh |
Updates the Package node. If the database object associated with the node was deleted from the database, you will be asked if the node needs to be deleted from the Server Explorer. |
Properties |
Displays the Properties window. |