DROP PACKAGE [BODY]

The DROP PACKAGE statement removes a stored package from the database. Both the specification and the body are dropped. DROP PACKAGE BODY removes only the body of the package.

Required privilege

No privilege is required for the package owner.

DROP ANY PROCEDURE for another user's package.

Usage with TimesTen Scaleout

This statement is supported with TimesTen Scaleout.

SQL syntax

DROP PACKAGE [BODY] [Owner.]PackageName

Parameters

Parameter Description

PACKAGE [BODY]

Specify BODY to drop only the body of the package. Omit BODY to drop both the specification and body of the package.

[Owner.]PackageName

Name of the package to be dropped.

Description

  • When you drop only the body of the package, TimesTen does not invalidate dependent objects. However, you cannot execute one of the procedures or stored functions declared in the package specification until you recreate the package body.

  • TimesTen invalidates any objects that depend on the package specification. If you subsequently reference one of these objects, then TimesTen tries to recompile the object and returns an error if you have not recreated the dropped package.

  • Do not use this statement to remove a single object from the package. Instead, recreate the package without the object using the CREATE PACKAGE and CREATE PACKAGE BODY statements with the OR REPLACE clause.

  • To use the DROP PACKAGE [BODY] statement, you must have PL/SQL enabled in your database. If you do not have PL/SQL enabled in your database, TimesTen returns an error.

Example

The following statement drops the body of package samplePackage:

Command> DROP PACKAGE BODY SamplePackage;
Package body dropped.

To drop both the specification and body of package samplepackage:

Command> DROP PACKAGE samplepackage;
Package dropped.

See also

CREATE PACKAGE