16.20 - Ways to Perform SQL Macros in Embedded SQL - Teradata Database - Teradata Vantage NewSQL Engine

Teradata Vantage™ SQL Fundamentals

Product
Teradata Database
Teradata Vantage NewSQL Engine
Release Number
16.20
Published
March 2019
Language
English (United States)
Last Update
2019-05-02
dita:mapPath
zce1519094756513.ditamap
dita:ditavalPath
TD_DBS_16_20_Update1.ditaval
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

    -or-

  • 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.