Previous |
Next |
To create a package body, use either the SQL Developer tool Create Body or the DDL statement CREATE
PACKAGE
BODY
.
This tutorial shows how to use the Create Body tool to create a body for the EMP_EVAL
package (created in "Tutorial: Creating a Package Specification" and changed in "Tutorial: Changing a Package Specification").
This package body will contain the implementation details of the sample application that the tutorials and examples in this document show how to develop and deploy.
To create a body for the package EMP_EVAL using the Create Body tool:
On the Connections tab, expand hr_conn.
Under the hr_conn
icon, a list of schema object types appears.
Expand Packages.
A list of packages appears.
Right-click EMP_EVAL.
A list of choices appears.
Click Create Body.
The EMP_EVAL
Body pane appears, showing the automatically generated code for the package body.
The title of the pane is in italic font, which indicates that the code is not saved in the database.
(Optional) In the CREATE
PACKAGE
BODY
statement:
Replace the comments with executable statements.
(Optional) In the executable part of the procedure, either delete NULL
or replace it with an executable statement.
(Optional) In the executable part of the function, either replace NULL
with another expression.
If you do not do this step now, you can do it later, as shown in "Tutorial: Declaring Variables and Constants in a Subprogram".
Click the icon Compile.
The changed package body compiles and is saved to the database. The title of the EMP_EVAL
Body pane is no longer in italic font.