16.10 - Ways to Perform SQL Macros in Embedded SQL - Teradata Database

Teradata Database SQL Fundamentals

Teradata Database
Release Number
Release Date
June 2017
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.