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

SQL Data Definition Language Syntax and Examples

Deployment
VantageCloud
VantageCore
Edition
VMware
Enterprise
IntelliFlex
Product
Analytics Database
Teradata Vantage
Release Number
17.20
Published
June 2022
ft:locale
en-US
ft:lastEdition
2025-11-06
dita:mapPath
jco1628111346878.ditamap
dita:ditavalPath
qkf1628213546010.ditaval
dita:id
mdr1472255012272
lifecycle
latest
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 the information about the Table operator in Teradata Vantage™ - SQL Data Manipulation Language, B035-1146.

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.

Limitations

The following functions cannot use CREATE FUNCTION MAPPING or REPLACE FUNCTION MAPPING:

  • TD_SYSFNLIB.DecisionForestPredict()
  • TD_SYSFNLIB.decisiontreepredict()
  • TD_SYSFNLIB.GLMPredict()
  • TD_SYSFNLIB.MOVINGAVERAGE()
  • TD_SYSFNLIB.NaiveBayesPredict()
  • TD_SYSFNLIB.NAIVEBAYESTEXTCLASSIFIERPREDICT()
  • TD_SYSFNLIB.NGRAMSPLITTER()
  • TD_SYSFNLIB.pack()
  • TD_SYSFNLIB.STRINGSIMILARITY()
  • TD_SYSFNLIB.SVMSPARSEPREDICT()
  • TD_SYSFNLIB.TD_ANOVA()
  • TD_SYSFNLIB.TD_BINCODEFIT()
  • TD_SYSFNLIB.TD_BINCODETRANSFORM()
  • TD_SYSFNLIB.TD_CATEGORICALSUMMARY()
  • TD_SYSFNLIB.td_chiSQ()
  • TD_SYSFNLIB.TD_CLASSIFICATIONEVALUATOR()
  • TD_SYSFNLIB.TD_COLUMNSUMMARY()
  • TD_SYSFNLIB.TD_CONVERTTO()
  • TD_SYSFNLIB.TD_FILLROWID()
  • TD_SYSFNLIB.td_ftest()
  • TD_SYSFNLIB.TD_FunctionFit()
  • TD_SYSFNLIB.TD_FunctionTransform()
  • TD_SYSFNLIB.TD_GETFUTILECOLUMNS()
  • TD_SYSFNLIB.TD_GETROWSWITHMISSINGVALUES()
  • TD_SYSFNLIB.TD_GETROWSWITHOUTMISSINGVALUES()
  • TD_SYSFNLIB.TD_HISTOGRAM()
  • TD_SYSFNLIB.TD_KMEANS()
  • TD_SYSFNLIB.TD_KMEANSPREDICT()
  • TD_SYSFNLIB.TD_NAIVEBAYESTEXTCLASSIFIERTRAINER()
  • TD_SYSFNLIB.TD_NONLINEARCOMBINEFIT()
  • TD_SYSFNLIB.TD_NONLINEARCOMBINETRANSFORM()
  • TD_SYSFNLIB.TD_NUMAPPLY()
  • TD_SYSFNLIB.TD_ONEHOTENCODINGFIT()
  • TD_SYSFNLIB.TD_ONEHOTENCODINGTRANSFORM()
  • TD_SYSFNLIB.TD_ORDINALENCODINGFIT()
  • TD_SYSFNLIB.TD_ordinalencodingtransform()
  • TD_SYSFNLIB.TD_outlierFilterFit()
  • TD_SYSFNLIB.TD_outlierFilterTransform()
  • TD_SYSFNLIB.TD_polynomialFeaturesFit()
  • TD_SYSFNLIB.TD_polynomialFeaturesTransform()
  • TD_SYSFNLIB.TD_QQNORM()
  • TD_SYSFNLIB.TD_REGRESSIONEVALUATOR()
  • TD_SYSFNLIB.TD_roundColumns()
  • TD_SYSFNLIB.TD_ROWNORMALIZEFIT()
  • TD_SYSFNLIB.TD_ROWNORMALIZETRANSFORM()
  • TD_SYSFNLIB.TD_SCALEFIT()
  • TD_SYSFNLIB.TD_SCALETRANSFORM()
  • TD_SYSFNLIB.TD_SENTIMENTEXTRACTOR()
  • TD_SYSFNLIB.TD_SILHOUETTE()
  • TD_SYSFNLIB.td_simpleimputefit()
  • TD_SYSFNLIB.td_simpleimputetransform()
  • TD_SYSFNLIB.TD_STRAPPLY()
  • TD_SYSFNLIB.TD_TextParser()
  • TD_SYSFNLIB.TD_UNIVARIATESTATISTICS()
  • TD_SYSFNLIB.TD_WHICHMAX()
  • TD_SYSFNLIB.TD_WHICHMIN()
  • TD_SYSFNLIB.TD_ZTEST()
  • TD_SYSFNLIB.unpack()