What is macro. What is the difference between macro and procedure.
A macro is the set of sql statements which can be run as a single statement.Macro Procedure
Macro returns set of data/rows to the user. It does not return data/rows to the user.
It is allows only input values. It provides Input/Output parameter.
It is stored in DBC Perm space. It is stored in DATABASE/USER Perm space.
To create a macro:
CREATE MACRO macro_name AS(SELECT eid, ename FROM emp WHERE deptno=20;);
To execute a macro:
EXEC macro_name;
To create a parametrized macro:
CREATE MACRO macro_name( in_param DATATYPE)
(SELECT eid, ename FROM emp WHERE deptno= :in_param;);
To execute a macro:
EXEC <macro_name> [parameter value list];
I really appreciate information shared above. It’s of great help. If someone want to learn Online (Virtual) instructor lead live training in Teradata , kindly contact us http://www.maxmunus.com/contact
ReplyDeleteMaxMunus Offer World Class Virtual Instructor led training on Teradata. We have industry expert trainer. We provide Training Material and Software Support. MaxMunus has successfully conducted 100000+ trainings in India, USA, UK, Australlia, Switzerland, Qatar, Saudi Arabia, Bangladesh, Bahrain and UAE etc.
For Free Demo Contact us:
Name : Arunkumar U
Email : arun@maxmunus.com
Skype id: training_maxmunus
Contact No.-+91-9738507310
Company Website –http://www.maxmunus.com