Database Macros | SQL Fundamentals | Teradata Vantage - Macros - Advanced SQL Engine - Teradata Database

SQL Fundamentals

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

A macro consists of one or more statements that can be executed by performing a single statement. Each time the macro is performed, one or more rows of data can be returned.

A frequently used SQL statement or series of statements can be incorporated into a macro and defined using the SQL CREATE MACRO statement.

The statements in the macro are performed using the EXECUTE statement.

A macro can include an EXECUTE statement that executes another macro.

Performing a macro is similar to performing a multistatement request.

Related Topics

For more information about:
  • The SQL CREATE MACRO statement, see “CREATE MACRO” in Teradata Vantage™ - SQL Data Definition Language Syntax and Examples, B035-1144.
  • The EXECUTE statement, see “EXECUTE (Macro Form)” in Teradata Vantage™ - SQL Data Manipulation Language, B035-1146.