Skip to main content

DROP FUNCTION

Drops a user-defined function. Only the owner of a UDF may drop it (there is no separate DROP FUNCTION privilege).

Syntax
DROP FUNCTION [ IF EXISTS ] <function_name>

Parameters

[ IF EXISTS ] String   Optional

If specified, prevents an exception when the function does not exist.


<function_name> String

The name of an existing user-defined function.

Examples

Create a function
CREATE FUNCTION hello() RETURNS VARCHAR RETURN 'Hello World!';
Remove an existing function
DROP FUNCTION hello;
Remove an existing function and prevent an exception if it does not exist
DROP FUNCTION IF EXISTS hello;