Package Body
Last modified: October 23, 2019
Package body is the initialization part of the package. It defines the queries for cursors and the code for subprograms included into the package. Procedure implementation details and private declarations are encapsulated in the package body and they are hidden from code outside the package.
Note
Sometimes package body is unnecessary.
Note
Subprograms defined in a package body are accessible outside the package only if their declarations are also present in the package specification. If a subprogram declaration is not included into the package specification, that subprogram can be called only by other subprograms in the same package.
PL/SQL allows two or more packaged subprograms to have the same name. This option is useful when you want a subprogram to accept similar sets of parameters that have different data types.
Creating a Package Body
- In the Database Explorer window, expand the Packages folder.
- Right click a required package, and then click Create Package Body.
- Fill a template with statements. dbForge Studio adds the CREATE/REPLACE words for you.
- Save the document.
Editing a Package Body
- In the Database Explorer window, expand the Packages folder.
- Right-click a required package, and then click Open Package Body to open its realization.
Want to find out more?
Overview
Take a quick tour to learn all about the key benefits delivered by dbForge Studio for Oracle.
All features
Get acquainted with the rich features and capabilities of the tool in less than 5 minutes.
Request a demo
If you consider employing this tool for your business, request a demo to see it in action.