You can use the DROP FUNCTION statement to drop an independent function from the database.
Applicability
This topic applies only to OceanBase Database Enterprise Edition. OceanBase Database Community Edition provides only the MySQL mode.
Notice
If the function to be dropped is part of a program package, do not use this statement to drop it. Instead, 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 function.
Prerequisites
The function must be located in your own schema, or you must have the ALTER ANY PROCEDURE system privilege.
Syntax
The syntax of 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 value is your schema. |
| drop_function | function_name | The name of the function to be dropped. |
Examples
Drop the function named sys.get_salary_by_dept.
DROP FUNCTION sys.get_salary_by_dept;