Oracle7 Server SQL Reference

Contents Index Home Previous Next

DROP PACKAGE

Purpose

To remove a stored package from the database.

Prerequisites

The package must be in your own schema or you must have DROP ANY PROCEDURE system privilege.

If you are using Trusted Oracle7 in DBMS MAC mode, your DBMS label must match the cluster's creation label or you must satisfy one of the following criteria:

Syntax

Keywords and Parameters

BODY

drops only the body of the package. If you omit this option, Oracle7 drops both the body and specification of the package.

schema

is the schema containing the package. If you omit schema, Oracle7 assumes the package is in your own schema.

package

is the name of the package to be dropped.

Usage Notes

When you drop the body and specification of a package, Oracle7 invalidates any local objects that depend on the package specification. If you subsequently reference one of these objects, Oracle7 tries to recompile the object and returns an error if you have not recreated the dropped package. For information on how Oracle7 maintains dependencies among schema objects, including remote objects, see the "Dependencies Among Schema Objects" chapter of Oracle7 Server Concepts.

When you drop only the body of a package but not its specification, Oracle7 does not invalidate dependent objects. However, you cannot call one of the procedures or stored functions declared in the package specification until you recreate the package body.

The DROP PACKAGE command drops the package and all its objects together. To remove a single object from a package, you can recreate the package without the object using the CREATE PACKAGE and CREATE PACKAGE BODY commands with the OR REPLACE option.

Example

The following statement drops the specification and body of the BANKING package, invalidating all objects that depend on the specification:

DROP PACKAGE banking 

Related Topics

CREATE PACKAGE command [*]


Contents Index Home Previous Next