15.10 - Macro - Teradata Database

Teradata Database SQL Data Definition Language Syntax and Examples

prodname
Teradata Database
vrm_release
15.10
created_date
December 2015
category
Programming Reference
featnum
B035-1144-151K
macro_name
The name of the macro whose most recent SQL create text is to be reported.

There is an upper limit of 12,500 characters that SHOW MACRO can display.

Example: SHOW MACRO

The following request displays the most recently executed definition of the new_emp macro.

     SHOW MACRO new_emp;

Teradata Database system reports the following macro definition.

     REPLACE MACRO new_emp(   
       name   CHARACTER(20) NOT NULL, 
       street CHARACTER(30), 
       city   CHARACTER(20), 
       number INTEGER, 
       dept   SMALLINT DEFAULT 999)
     AS (INSERT INTO employee (name, street, city,
                   emp_no, dept_no)
           VALUES (:name, :street, :city, :number, :dept); 
          UPDATE department 
           SET emp_count = emp_count + 1 
          WHERE  dept_no = :dept;);