You can use the DROP PROCEDURE statement to drop an independent stored procedure from OceanBase Database.
Notice
Do not use this statement to drop stored procedures from program packages. To drop a stored procedure from a program package, use the
DROP PACKAGEstatement to drop the entire program package, or use aCREATE PACKAGEstatement with anOR REPLACEclause to redefine a program package without this stored procedure.
Prerequisites
The stored procedure must be located in the schema of the current user, or the user must have the ALTER ANY PROCEDURE system privilege.
Syntax
Syntax of drop_procedure:
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 your 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 are dependent on this stored procedure. If any of these objects is referenced later, the database attempts to recompile this object. If the dropped stored procedure has not been re-created, the database returns an error message. |
Examples
Drop the stored procedure named userlogin.
DROP PROCEDURE userlogin;