Your browser does not support JavaScript. This help page requires JavaScript to render correctly. Tutorial: Changing a Package Specification
Skip Headers
Previous
Previous
 
Next
Next

Tutorial: Changing a Package Specification

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:

  1. On the Connections tab, expand hr_conn.

    Under the hr_conn icon, a list of schema object types appears.

  2. Expand Packages.

    A list of packages appears.

  3. Right-click EMP_EVAL.

    A list of choices appears.

  4. 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.

  5. 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.

  6. 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.

Related Topics

Oracle Database PL/SQL Language Reference

Creating and Managing Packages