CREATE/REPLACE FUNCTION MAPPING | SQL Statements | VantageCloud Lake - CREATE FUNCTION MAPPING and REPLACE FUNCTION MAPPING - Teradata VantageCloud Lake

Lake - Working with SQL

Deployment
VantageCloud
Edition
Lake
Product
Teradata VantageCloud Lake
Release Number
Published
February 2025
ft:locale
en-US
ft:lastEdition
2025-11-21
dita:mapPath
jbe1714339405530.ditamap
dita:ditavalPath
pny1626732985837.ditaval
dita:id
jbe1714339405530

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 running 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 in the Database.

To run 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 Table Operator.

In the READ_NOS table function, you can use either a function mapping or the AUTHORIZATION clause. Using both is an error.

Required Privileges

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.