O'Reilly logo

V14 Certification: Teradata SQL by Tom Coffing, Leona Coffing

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 15 – Macro Functions

“Don’t count the days. Make the days count.”

-Muhammad Ali

The Rules of Macros

Macros can contain one or more SQL Statements

Macros are a database Extension in Teradata and not ANSI-Standard

Macros do NOT require PERM Space

Macros are stored in the Data Dictionary in the USER DBC

Every statement in the macro must end in a semi-colon ;

Only one DDL Statement can exist in a Macro and it must be the last statement

Input Parameters can be passed to the Macro

Macros run when users use the EXEC Macro Command

Macros can be executed from any viable front end, especially the Nexus

Macros can call views and even other Macros

All SQL Statements inside a Macro are considered one Transaction

Each Macro name must be a unique object ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required