Teradata Macro
http://learnteradatardbms.com
Macro
you want to ensure you don't forget an SQL
step you should use a macro.
The user sometimes forgets, but the macro
always remembers. Good one
A macro is a group of one or more SQL
statements that are given a name and that are
executed with a simple command.
Macro
If there are multiple commands, Teradata treats
them as one single transaction.
In other words, either they all work or none of
them work. Like views, the definition statement
for a macro is stored in the Data Dictionary.
Sample macro
CREATE MACRO Employee_mac AS
(
SELECT * from Employ1_v WHERE dept = 10;
SELECT * from Employ1_v WHERE dept = 20;
SELECT * FROM Employ1_v Order by lname;
);
Execute Macro
Execute Employee_mac;
Thank You
Read more at
http://learnteradatardbms.blogspot.com

Macro teradata

  • 1.
  • 2.
    Macro you want toensure you don't forget an SQL step you should use a macro. The user sometimes forgets, but the macro always remembers. Good one A macro is a group of one or more SQL statements that are given a name and that are executed with a simple command.
  • 3.
    Macro If there aremultiple commands, Teradata treats them as one single transaction. In other words, either they all work or none of them work. Like views, the definition statement for a macro is stored in the Data Dictionary.
  • 4.
    Sample macro CREATE MACROEmployee_mac AS ( SELECT * from Employ1_v WHERE dept = 10; SELECT * from Employ1_v WHERE dept = 20; SELECT * FROM Employ1_v Order by lname; );
  • 5.
  • 6.
    Thank You Read moreat http://learnteradatardbms.blogspot.com