Introduction to SQL External Routine Programming - Teradata Vantage - Analytics Database

SQL External Routine Programming

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-03-30
dita:mapPath
iiv1628111441820.ditamap
dita:ditavalPath
qkf1628213546010.ditaval
dita:id
qnu1472247494689
lifecycle
latest
Product Category
Teradata Vantage™

Teradata Vantage™ - SQL External Routine Programming describes how to program Teradata user-defined functions (UDFs), user-defined methods (UDMs), and external stored procedures, which are collectively called external routines.

Customers using Vantage delivered as-a-service cannot create their own C++ and Java UDFs, UDMs, UDTs, or External Stored Procedures.

Using SQL External Routine Programming

This document is primarily for application programmers and provides the following information:
  • Describes how to create Teradata user-defined functions (UDFs), user-defined methods (UDMs), and external stored procedures, which are collectively called external routines
  • How to use global and persistent (GLOP) data in the UDFs, UDMs, and external stored procedures that you create
  • How to run R scripts to analyze data stored in Analytics Database
  • How to write R table operators

Why Would I Use this Content?

Use this content if you want to do the following:
  • Create UDFs or external stored procedures in C, C++, or Java
  • Create UDMs in C or C++
  • Create C or C++ UDFs, UDMs, and external stored procedures that use GLOP data
  • Install R components and packages
  • Run R scripts or create R table operators

How Do I Use this Content?

Depending on the function, external stored procedure, method, or table operator you want to create, go to the relevant section.

How Do I Get Started?

To create C, C++, or Java external routines:
  1. Go to the relevant section which describes how to create the UDF, external stored procedure, or UDM using the programming language of your choice. For example, C/C++ User-Defined Functions.
  2. Review the system requirements, configuration settings, and other administrative tasks that you may have to perform. See Administration.
  3. Review how C and Java data types map to SQL data types for use as parameters and return types in your external routine. See SQL Data Type Mapping.
  4. Review the C library functions and Java application classes you can use when developing your external routine. See C Library Functions or Java Application Classes.
  5. See the code examples, such as UDF Code Examples.
To run R scripts or create R table operators:
  1. Install the necessary R components and packages. See Installation of R Components and Packages.
  2. If you want to run R scripts, you can use the SCRIPT table operator. For details about SCRIPT, see the "Table Operators" section in Teradata Vantage™ - SQL Operators and User-Defined Functions, B035-1210.
  3. If you want to run R scripts using the ExecR system table operator, or write R table operators that can be executed by ExecR, see R Table Operators.

References to Other Relevant Content

Use Teradata Vantage™ - SQL External Routine Programming in conjunction with the other volumes of the SQL document set, in particular the following documents:
  • Teradata Vantage™ - SQL Data Definition Language Syntax and Examples, B035-1144
  • Teradata Vantage™ - Database Administration, B035-1093
  • Teradata Vantage™ - SQL Data Manipulation Language, B035-1146
  • Teradata Vantage™ - Data Types and Literals, B035-1143
R resources: