17.10 - Ways to Execute SQL Macros in Embedded SQL - Advanced SQL Engine - Teradata Database

Teradata Vantage™ - SQL Fundamentals

Advanced SQL Engine
Teradata Database
Release Number
Release Date
July 2021
Content Type
Programming Reference
Publication ID
English (United States)
IF the macro … THEN use …
is a single statement, and that statement returns no data
  • the EXEC statement to specify static execution of the macro


  • the PREPARE and EXECUTE statements to specify dynamic execution.

Use DESCRIBE to verify that the single statement of the macro is not a data returning statement.

  • consists of multiple statements
  • returns data
a cursor, either static or dynamic.

The type of cursor used depends on the specific macro and on the needs of the application.