CREATE/REPLACE FUNCTION MAPPING | SQL Statements | Teradata Vantage - CREATE FUNCTION MAPPING and REPLACE FUNCTION MAPPING - Advanced SQL Engine - Teradata Database

SQL Data Definition Language Syntax and Examples

Product
Advanced SQL Engine
Teradata Database
Release Number
17.00
Published
September 2020
Language
English (United States)
Last Update
2021-01-23
dita:mapPath
wgr1555383704548.ditamap
dita:ditavalPath
lze1555437562152.ditaval
dita:id
B035-1144
lifecycle
previous
Product Category
Teradata Vantage™

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 "Table Operator" in Teradata Vantage™ - SQL Data Manipulation Language, B035-1146.

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.