Package Body Nodes
This section covers the following topics:
About the Package Body
The package body contains the implementation of every cursor and subprogram declared in the package specification. Subprograms defined in a package body are accessible outside the package only if their specifications appear in the package specification. If a subprogram specification is not included in the package specification, that subprogram can only be called by other subprograms in the same package.
How the Package Body Node Works
The Package Body node is one of three child nodes of the Packages node, with the two representing package specification functions and procedures.
A package body node with an error is indicated by a red x in the node icon.
To fix the error, open the package body code in the PL/SQL editor, make the required changes and execute the Compile command on the node. If the package body has no errors, the x is removed from the node.
Package body nodes that have been compiled with debug information have DBG embedded in the icon.
Double-clicking on the package body node opens the PL/SQL editor and loads the package body PL/SQL code.
To perform actions on the Package Body 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 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, Edit Package Body 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 |
Compile |
Performs the following actions:
See PL/SQL Compiler Settings Options Page for compile settings. |
Compile Debug |
Compiles the package body 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 package body definition to a |
Generate Create Script to Project |
Generates the package body 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. |
Delete |
Drops the package body from the database. |
Refresh |
Updates the Package Body 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. |