CREATE FUNCTION MAPPING creates a new function mapping with the name that you specify.
REPLACE FUNCTION MAPPING replaces the definition of an existing function mapping or, if the specified function mapping does not exist, creates a new function mapping by that name.
You use a function mapping to specify a simple name for executing a function or table operator within a database, user, or on an external server. The function mapping defines input tables, output tables, and other parameters to use during function execution. See Example: Defining a Function Mapping, Example: Replacing a Function Mapping Definition, and Example: Function Mapping Definition for a Function Within the Database.
To execute the function or table operator, you specify the function mapping in a SELECT statement FROM clause using the table operator syntax. For information about function processing, see the information about the Table operator in Teradata Vantage™ - SQL Data Manipulation Language, B035-1146.
For a table operator on an external server, you must have the EXECUTE FUNCTION privilege on the server. For a table operator stored within the database or user, you must have the EXECUTE FUNCTION privilege on the table operator.
For CREATE FUNCTION MAPPING, you must have CREATE FUNCTION privilege on the database or user where you create the function mapping.
For REPLACE FUNCTION MAPPING where you are creating a function mapping, you must have CREATE FUNCTION privilege on the database or user.
For REPLACE FUNCTION MAPPING where you are replacing a function mapping, you must have the DROP FUNCTION privilege on the function mapping or containing database or user.
For a function mapping that includes a scalar subquery (SSQ), you must have the SELECT privilege on the table referenced by the subquery.
Privileges Granted Automatically
When you create or replace a function mapping object, you are granted EXECUTE and DROP FUNCTION privileges on the function mapping object.