Updated on 2024-06-03 GMT+08:00

DROP PACKAGE

Description

Deletes the existing package or package body.

Precautions

After the package body is deleted, the stored procedures and functions in the package become invalid at the same time.

Syntax

DROP PACKAGE [ IF EXISTS ] package_name;
DROP PACKAGE BODY [ IF EXISTS ] package_name;

Parameters

  • IF EXISTS

    Reports a notice instead of an error if the specified stored procedure does not exist.

  • package_name

    Specifies the name of the package to be deleted.

    Value range: an existing package name.

Examples

-- Create a package.
gaussdb=# CREATE OR REPLACE PACKAGE PCK1
IS
a int;
END pck1;
/
CREATE PACKAGE

-- Delete the package.
gaussdb=# DROP PACKAGE PCK1;
DROP PACKAGE

Helpful Links

ALTER PACKAGE and CREATE PACKAGE