DROP PACKAGE

2023-10-31 11:17:11  Updated

You can use the DROP PACKAGE statement to drop a stored package from the database. This statement will drop the specification and body of the package.

Applicability

This topic applies only to OceanBase Database Enterprise Edition. OceanBase Database Community Edition provides only MySQL mode.

Notice

Do not use this statement to remove a single object from a package. To remove an object from a package, you need to re-create a program package without this object by using the CREATE PACKAGE and CREATE PACKAGE BODY statements with the OR REPLACE clause.

Prerequisites

The program package must be located in your own schema, or you must have the ALTER ANY PACKAGE system privilege.

Syntax

The syntax of drop_package is as follows:

DROP PACKAGE [ BODY ] [ schema. ] package ;

Semantics

Syntax Keyword or syntax node Description
drop_package BODY Drops only the package body. If this clause is omitted, the database will drop both the specification and body of the package. If only the package body is dropped, the database will not invalidate dependent objects. However, before the package body is re-created, you cannot call stored procedures or functions declared in the package specification.
drop_package schema The name of the schema where the program package is located. The default value is your schema.
drop_package package The name of the program package to be dropped. The database will invalidate all local objects that are dependent on the package specification. If these dependent objects are referenced later, the database will try to recompile them. If the dropped program package has not been re-created, an error is returned. If any statistical information type is associated with the program package, the database will dissociate this statistical information type from the FORCE clause, and delete any user-defined statistical information collected by using this statistical information type.

Examples

Drop the program package named obdemo_pack.

DROP PACKAGE obdemo_pack;

Contact Us