> 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-body.md).

# DROP PACKAGE BODY

Delete the body of a stored package. This command removes the implementation logic while preserving the package specification and interface.

## Syntax

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

## Description

From MariaDB 11.4, the `DROP PACKAGE BODY` 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 BODY` statement drops the package body (that is, the implementation) which was created using the [CREATE PACKAGE BODY](https://mariadb.com/docs/server/reference/sql-statements/data-definition/create/create-package-body.md) statement.

Note, `DROP PACKAGE BODY` drops only the package implementation, but does not drop the package specification. Use [DROP PACKAGE](https://mariadb.com/docs/server/reference/sql-statements/data-definition/drop/drop-package.md) to drop the package entirely (i.e. both implementation and specification).

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 body are revoked from all accounts and roles. `CREATE OR REPLACE PACKAGE BODY` 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

* [CREATE PACKAGE](https://mariadb.com/docs/server/reference/sql-statements/data-definition/create/create-package.md)
* [SHOW CREATE PACKAGE](https://mariadb.com/docs/server/reference/sql-statements/administrative-sql-statements/show/show-create-package.md)
* [DROP PACKAGE](https://mariadb.com/docs/server/reference/sql-statements/data-definition/drop/drop-package.md)
* [CREATE PACKAGE BODY](https://mariadb.com/docs/server/reference/sql-statements/data-definition/create/create-package-body.md)
* [SHOW CREATE PACKAGE BODY](https://mariadb.com/docs/server/reference/sql-statements/administrative-sql-statements/show/show-create-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" %}
