CALLING MACRO in Teradata

You can call macro by,

EXEC <macro name>


Example:

Consider the macro below,
CREATE MACRO mc_employee AS
(
SELECT * FROM tbl_employee;
);


EXEC mc_employee;


Calling Parameterized macro:
CREATE MACRO mc_employee (id INT) AS
(
SELECT * FROM tbl_employee WHERE emp_no > :id;
);

To execute,
EXEC <macroname>(parameter);

For the above example,
EXEC mc_employee(10);