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.

Edit Package Body

Opens the package body in the PL/SQL Code Editor

Compile

Performs the following actions:

  1. If the package is open in the PL/SQL Editor and has been changed, saves the changes to the database.

  2. If the package body is open in the PL/SQL Editor and has been changed, saves the changes to the database.

  3. Compiles the package specification and package body.

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 .sql file.

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 .sql file and adds the .sql file to an open Oracle Database Project.

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.