The DROP PROCEDURE statement is used to delete a standalone stored procedure from the database.
Applicability
This topic applies only to OceanBase Database Enterprise Edition. OceanBase Database Community Edition does not support this feature.
Notice
Do not use this statement to drop a stored procedure from a package. To drop a package, use the DROP PACKAGE statement. To redefine a package that does not contain the stored procedure, use the CREATE PACKAGE statement with the OR REPLACE clause.
Prerequisites
The stored procedure must be in the current user's schema, 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 |
Keyword or syntax node |
Description |
|---|---|---|
| drop_procedure | schema | The name of the schema where the stored procedure is located. The default value is the current user's schema. |
| drop_procedure | procedure_name | The name of the stored procedure to be dropped. When a stored procedure is dropped, the database invalidates all local objects that depend on the dropped stored procedure. If these objects are subsequently referenced, the database attempts to recompile them. If the dropped stored procedure has not been recreated, an error message is returned. |
Examples
Drop the stored procedure userlogin.
DROP PROCEDURE userlogin;
