Skip to main content

DROP FUNCTION Enterprise

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

Syntax
DROP FUNCTION [ IF EXISTS ] <function_name>
[ AS OF <timestamp> ]

To run DROP FUNCTION, users need the OWNERSHIP privilege on the UDF.

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.


AS OF <timestamp> String   Optional

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;