Macros and Tactical Queries - Teradata VantageCloud Lake

Lake - Database Reference

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

Multiple SQL statements within a macro are performed as a single request. The macro code can also specify parameters that are replaced by data each time the macro is performed. The most common way of substituting for the parameters is to specify a USING Request Modifier .

For repetitive queries, macros are typically more efficient than single DML statements. Unlike procedures, which return parameters to the requestor, macros return only the answer set for their SQL statements.

Macros have the following advantages:
  • Network and channel traffic are reduced.
  • Run plans can be cached, reducing parsing engine overhead.
  • Macros ensure the efficient performance of their component SQL statements.
  • Reusable database components save client resources.
  • Macros can be used to force data integrity and locking modifiers.
  • Macros can be used to enforce security.