Remove a function.
DROP FUNCTION [ IF EXISTS ] name [ ([ [ argmode ] [ argname ] argtype ] [, ...]) ] [ CASCADE | RESTRICT ]
You can run the
DROP FUNCTION command to remove an existing function. To run this command, you must be a superuser
or the owner of the function. All data types of the input argument in the mode of
IN OUT to the function must be specified if this is an overloaded function. This requirement
is not compatible with Oracle databases. In Oracle, only the function name is specified.
PolarDB for Oracle allows overloading of function names, so the function signature provided by the input
argument data types is required in the DROP FUNCTION command of an overloaded function.
The usage of
RESTRICT is not compatible with Oracle databases and is used only by PolarDB for Oracle.
|IF EXISTS||Dose not throw an error if the function does not exist. In this case, a notification is issued.|
|name||The name of an existing function, which may be optional and schema-qualified.|
|argmode||The mode of an argument. Valid values:
|argname||The name of an argument. The
|argtype||The data type of an argument of the function. The specification of argtype is not compatible with Oracle databases and applies only to PolarDB for Oracle.|
|CASCADE||Automatically drop objects that depend on the function (such as operators or triggers), and in turn all objects that depend on those objects.|
|RESTRICT||Refuses to drop the function if any objects depend on it. This is the default value.|
The following command removes the emp_comp function.
DROP FUNCTION emp_comp(NUMBER, NUMBER);