17.10 - Differences Between CREATE FUNCTION and REPLACE FUNCTION - Advanced SQL Engine - Teradata Database

Teradata Vantage™ - SQL Data Definition Language Detailed Topics

Product
Advanced SQL Engine
Teradata Database
Release Number
17.10
Release Date
July 2021
Content Type
Programming Reference
Publication ID
B035-1184-171K
Language
English (United States)

A function can be created or replaced using the same syntax except for the keywords CREATE and REPLACE.

If you specify CREATE, the function must not exist.

If you specify REPLACE, you can either create a new function or replace an existing function with the following restriction: if the function to be replaced was originally created with a specific function name, then that specific function name must be used for the REPLACE FUNCTION statement.

The advantage to using REPLACE is that you can avoid having to grant the EXECUTE privilege again to all users who already had that privilege on the function.