The DROP PROCEDURE statement deletes an independent stored procedure from the database.
Applicability
This topic applies only to OceanBase Database Enterprise Edition. OceanBase Database Community Edition provides only MySQL-compatible mode.
Notice
You cannot use this statement to drop a stored procedure from a package. To do so, you must use the DROP PACKAGE statement to drop the entire package or use the CREATE PACKAGE statement with the OR REPLACE clause to redefine a package without the stored procedure.
Prerequisites
The stored procedure must be in the schema of the current user or the user must have the ALTER ANY PROCEDURE system privilege.
Syntax
The syntax of drop_procedure is as follows:
DROP PROCEDURE [ schema. ] procedure ;
Semantics
| Syntax | Keywords and syntax node | Description |
|---|---|---|
| drop_procedure | schema | The name of the schema in which the stored procedure is located. The default value is the schema of the current user. |
| drop_procedure | procedure_name | The name of the stored procedure to be dropped. When a stored procedure is dropped, all local objects that depend on it become invalid. If these objects are subsequently referenced, the database attempts to recompile them. If the deleted stored procedure has not been re-created, an error is returned. |
Examples
Drop the userlogin stored procedure.
DROP PROCEDURE userlogin;