Packages Node
This section covers the following topics:
About Packages
A package is an encapsulated collection of related procedures, functions, and other object types grouped together into one programming unit in the database. As such, packages allow you to run a series of related tasks, with each task represented by a procedure or function.
PL/SQL packages have two parts:
-
Package specification: The interface to your application. It declares the procedures, functions, types, variables, constants, exceptions, cursors, and subprograms available for use. These are the public declarations that are visible in your application. The package specification is also known as the package header.
-
Package body: Defines the implementation details and private declarations that are hidden from your application. You can debug, enhance, or replace a package body without changing the specification. In addition, you can change a package body without recompiling calling programs because the implementation details in the body are hidden from your application. However, depending on the package definition, sometimes the body is not necessary. Another advantage of separating the package body from the package specification is that it lets you keep your proprietary code secure.
For more information on how PL/SQL packages work, including the packages supplied with Oracle Database, see PL/SQL Packages and Types Reference.
How the Packages Node Works
The Packages node contains one or more child Package nodes associated with this schema. Within each of these child package nodes are nodes representing procedures and functions.
To perform actions on the Packages 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.
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 Package |
Creates a new package using the Package Designer. |
Query Window |
Opens the Query Window so that you can execute SQL and PL/SQL queries from Visual Studio. |
Generate Create Script |
Writes the package definitions to a If the object associated with the packages 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 package 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 Package node tree, including its associated child nodes. |
Properties |
Displays the Properties window. |