Parameterized Macro in Teradata

Syntax:
CREATE MACRO macro_name [parameters] AS
(
<SQL statements>
);


Simple macro:
CREATE MACRO mc_employee AS
(
SELECT * FROM tbl_employee;
);


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);