Previous |
Next |
To change a package specification, use either the SQL Developer tool Edit or the DDL statement CREATE
PACKAGE
with the OR
REPLACE
clause.
This tutorial shows how to use the Edit tool to change the specification for the EMP_EVAL
package (created in "Tutorial: Creating a Package Specification"). Specifically, the tutorial shows how to add declarations for a procedure, eval_department
, and a function, calculate_score
.
To change EMP_EVAL package specification using the Edit 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 Edit.
The EMP_EVAL
pane opens, showing the CREATE
PACKAGE
statement that created the package.
The title of the pane is not in italic font, which indicates that the package is saved in the database.
In the EMP_EVAL
pane, replace the comment with this code:
PROCEDURE eval_department ( dept_id IN NUMBER ); FUNCTION calculate_score ( evaluation_id IN NUMBER , performance_id IN NUMBER) RETURN NUMBER;
A new EMP_EVAL
pane opens, showing the changed CREATE
PACKAGE
statement. The title of the pane is in italic font, which indicates that the changes have not been saved to the database.
Click the icon Compile.
The changed package specification compiles and is saved to the database. The title of the EMP_EVAL
pane is no longer in italic font.