SHOW commands Teradata

There are times when you need to recreate a table, view, or macro that you already have, or you need to create another object of the same type that is either identical or very similar to an object that is already created. When this is the case, the SHOW command is a way to accomplish what you need.

We will be discussing all of these object types and their associated Data Definition Language (DDL) commands later in this course.

The intent of the SHOW command is to output the CREATE statement that could be used to recreate the object of the type specified.

SHOW commands

To see the CREATE TABLE command for the Employee table, we use the command:

To see the CREATE MACRO command for the macro called MYREPORT, we use a
command like:

Since the SHOW command returns the DDL, it can be a real time saver. It is a very helpful tool when a database object needs to be recreated, a copy of an existing object is needed, or another object is needed that has similar characteristics to an existing object. Plus, what a great way to get a reminder on the syntax needed for creating a table, view, macro, or trigger.

It is a good idea to save the output of the SHOW command in case it is needed at a later date. However, if the object's structure changes, the SHOW command should be reexecuted and the new output saved. It returns the DDL that can be used to create a new table exactly the same as the current table. Normally, at a minimum, the table name is changed before executing the command

All rights reserved © 2018 Wisdom IT Services India Pvt. Ltd Protection Status

Teradata Topics