The DROP FUNCTION statement is used to delete a standalone function from the database.
Applicability
This topic applies only to OceanBase Database Enterprise Edition. OceanBase Database Community Edition provides only MySQL-compatible mode.
Notice
If the function is part of a package, do not use this statement to drop the function. To drop the entire package, use the DROP PACKAGE statement. To redefine the package without the function, use the CREATE PACKAGE statement with the OR REPLACE clause.
Prerequisites
The function must be in the current user's schema, or the user must have the ALTER ANY PROCEDURE system privilege.
Syntax
The syntax for drop_function is as follows:
DROP FUNCTION [ schema. ] function_name ;
Semantics
| Syntax | Keyword or syntax node | Description |
|---|---|---|
| drop_function | schema | The name of the schema where the function is located. The default is the current user's schema. |
| drop_function | function_name | The name of the function to be dropped. |
Examples
Drop the function sys.get_salary_by_dept.
DROP FUNCTION sys.get_salary_by_dept;