|
Archives of the TeradataForumMessage Posted: Wed, 11 Aug 2010 @ 19:51:58 GMT
Hi, Here is syntax.. Example : 1 CREATE MACRO Empinfo AS ( SELECT EmplId (TITLE 'Id') ,LastName (TITLE 'Name') ,City (TITLE 'City') FROM employee1 ORDER BY 2; SELECT EmplId (TITLE 'Id') ,LastName (TITLE 'Name') ,City (TITLE 'City') FROM employee2 ORDER BY 2; ); Example 2 : CREATE MACRO NewEmpl (number INTEGER ,name VARCHAR(12) ,dept INTEGER ,sex CHAR ,dob DATE FORMAT MMMbDDbYYYY ) AS ( INSERT INTO employee (EmplId ,LastName ,DeptNo ,Sex ,DOB) VALUES (:number ,:name ,:dept ,:sex ,:dob); /* The following select verifies the insert or can say SQL-2 */ SELECT * FROM employee WHERE EmplId= :number; ); Best Regards, Kapil Dev Sapra
| ||||||||||||||||||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||||||||||||||||||
Copyright 2016 - All Rights Reserved | ||||||||||||||||||||||||||||||||||||||||||||||||
Last Modified: 15 Jun 2023 | ||||||||||||||||||||||||||||||||||||||||||||||||