> For the complete documentation index, see [llms.txt](https://mariadb.com/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://mariadb.com/docs/server/reference/sql-statements/data-definition/drop/drop-package.md).

# DROP PACKAGE

Remove a stored package completely. This command deletes both the package specification (interface) and its body (implementation) from the database.

## Syntax

```bnf
DROP PACKAGE [IF EXISTS]  [ db_name . ] package_name
```

## Description

From MariaDB 11.4, the `DROP PACKAGE` statement can be used in any mode. Before MariaDB 11.4, it can be used only when [Oracle SQL\_MODE](https://mariadb.com/docs/server/editions-and-compatibility/comparisons-with-other-databases/sql_modeoracle.md) is set.

The `DROP PACKAGE` statement drops a stored package entirely:

* Drops the package specification (earlier created using the [CREATE PACKAGE](https://mariadb.com/docs/server/reference/sql-statements/data-definition/create/create-package.md) statement).
* Drops the package implementation, if the implementation was already created using the [CREATE PACKAGE BODY](https://mariadb.com/docs/server/reference/sql-statements/data-definition/create/create-package-body.md) statement.

If [automatic\_sp\_privileges](https://mariadb.com/docs/server/server-management/variables-and-modes/server-system-variables.md#automatic_sp_privileges) is set (the default), privileges on the package and its body are revoked from all accounts and roles. `CREATE OR REPLACE PACKAGE` keeps them. See [Stored Routine Privileges](https://mariadb.com/docs/server/server-usage/stored-routines/stored-functions/stored-routine-privileges.md#dropping-stored-routines).

## See Also

* [SHOW CREATE PACKAGE](https://mariadb.com/docs/server/reference/sql-statements/administrative-sql-statements/show/show-create-package.md)
* [CREATE PACKAGE](https://mariadb.com/docs/server/reference/sql-statements/data-definition/create/create-package.md)
* [CREATE PACKAGE BODY](https://mariadb.com/docs/server/reference/sql-statements/data-definition/create/create-package-body.md)
* [DROP PACKAGE BODY](https://mariadb.com/docs/server/reference/sql-statements/data-definition/drop/drop-package-body.md)
* [Oracle SQL\_MODE](https://mariadb.com/docs/server/editions-and-compatibility/comparisons-with-other-databases/sql_modeoracle.md)

<sub>*This page is licensed: CC BY-SA / Gnu FDL*</sub>

{% @marketo/form formId="4316" %}
