DROP PROCEDURE

2024-06-28 05:30:31  Updated

You can use the DROP PROCEDURE statement to drop an independent stored procedure from OceanBase Database.

Applicability

This topic applies only to OceanBase Database Enterprise Edition. OceanBase Database Community Edition provides only the MySQL mode.

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 PACKAGE statement to drop the entire program package, or use a CREATE PACKAGE statement with an OR REPLACE clause to redefine a program package without this stored procedure.

Prerequisites

The stored procedure must be located in your own schema, or you 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 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;

Contact Us