O'Reilly logo

Tera-Tom on Teradata SQL V12-V13 by Tera-Tom 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 Processing

Macros

Compatibility: Teradata Extension

Macros are SQL statements stored as an object in the Data Dictionary (DD). Unlike a view, a macro can store one or multiple SQL statements. Additionally, the SQL is not restricted to only SELECT operations. INSERT, UPDATE, and DELETE commands are valid within a macro. When using BTEQ, conditional logic and BTEQ commands may also be incorporated into the macro.

The use of macros provide the benefits, listed below:

  • Stored in the DD
    • Can be shared by multiple users
    • SQL is stored in Teradata and not sent across the network or channel
  • Can be secured to keep users from accessing them
  • Provide the access security to tables
  • All updates within a macro are considered a transaction ...

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