ALTER FUNCTION (UDF or UDT)

Alters a user defined function (UDF) or user-defined transform (UDT).

Syntax

ALTER FUNCTION... [[db-name.]schema.]function-name([arg-type1,] ...)
... | SET SCHEMA new_schema
... | RENAME TO new_name
... | SET FENCED bool_val
... | OWNER TO new_owner

Parameters

[db-name.]schema

Specifies a schema. If multiple schemas are defined in the database, include the schema name. For example:

myschema.thisDbObject

If you do not specify a schema, the table is created in the default schema.

function-name

The name of the UDF to alter. You must specify the argument type list, which may be empty.

RENAME TO new_name

Specifies the new name of the function

SET SCHEMA new_schema

Specifies the new schema name where the function resides.

OWNER TO new_owner
Specifies the new owner of the function.
SET FENCED bool_val

A boolean value that specifies if Fenced Mode is enabled for this function. Valid values are:

true - enables Fenced Mode

false - disables Fenced Mode

Fenced Mode is not available for User Defined Aggregates or User Defined Load.

Privileges

Examples

This example renames a function called UDF_one to UDF_two:

=> ALTER FUNCTION UDF_one (int,int) RENAME TO UDF_two;

This example moves the UDF_two function to a new schema called macros:

=> ALTER FUNCTION UDF_two (int) SET SCHEMA macros;

This example disables Fenced Mode for the UDF_two function:

=> ALTER FUNCTION UDF_two (int, int) SET FENCED false;