Create macro< macro name>(<params>)AS(SQL Queries);
Replace macro< macro name>(<params>)AS(SQL Queries);
Drop macro< macro name>
SHOW macro< macro name>
Exec < macro name>(<params>) OR Execute< macro name>>(<params>) CREATE macro mc – party2 (partyid1 integer)
As(Select* From party where party id =:party id1 or party name> :party income1;)
Exe mc- party2 (2,20000)
Inclined to build a profession as Teradata Developer? Then here is the blog post on, explore Teradata Training
MACROS may be used for either of the following purposes: To ensure data integrity that the data conforms to certain or value restrictions To ensure referential integrity that the data being input as foreign keys have legal primary key values else wherein the database Create as a macro which inserts a new party member row with the following restrictions Party must be over 21 years of age Party must be assigned a valid party code. Create macro new – party (pid integer, pname varchar(30),pcode integer, Hired data, birth date)
As(Rollback work ’Invalid Here’)
Where(:Hired- birth)/365<21;
Rollback work ’Invalid party code’
Where: pcode not in (Select party code from a party where party code =: pacode);
Insert into the party(Party id, party name, party code, j date)
Values(:pid: p name, :p code: hired););
exe new party (19,’ meer’, 40,’2010-08-06’,’2010-08-06’)
exe new party(19,’ meer’,40,’2010-08-06,’’1981-08-06’)
You liked the article?
Like: 0
Vote for difficulty
Current difficulty (Avg): Medium
TekSlate is the best online training provider in delivering world-class IT skills to individuals and corporates from all parts of the globe. We are proven experts in accumulating every need of an IT skills upgrade aspirant and have delivered excellent services. We aim to bring you all the essentials to learn and master new technologies in the market with our articles, blogs, and videos. Build your career success with us, enhancing most in-demand skills in the market.