17.00 - Example: SHOW For a SELECT Request Using the QUALIFIED Option - Advanced SQL Engine - Teradata Database

Teradata Vantage™ - SQL Data Definition Language Syntax and Examples

Product
Advanced SQL Engine
Teradata Database
Release Number
17.00
Release Date
September 2020
Content Type
Programming Reference
Publication ID
B035-1144-170K
Language
English (United States)

Notice that none of the views in Example: SHOW For a SELECT Request That Accesses Multiple Views is qualified by the name of its containing database.

Use the QUALIFIED option to produce a report that resolves the ambiguous dependencies.

Consider the same scenario used in Example: SHOW For a SELECT Request That Accesses Multiple Views, but this time specify that the report must be qualified.

     SHOW QUALIFIED SELECT * 
                    FROM view_3;

The report looks like this.

     *** Text of DDL statement returned.
     *** Total elapsed time was 1 second.
     -------------------------------------------------------------
     CREATE SET TABLE international.table_1, NO FALLBACK,
     NO BEFORE JOURNAL,
     NO AFTER JOURNAL
     (zno INTEGER)
     PRIMARY INDEX (a);
     *** Text of DDL statement returned.
     -------------------------------------------------------------
     CREATE SET TABLE us.table_1, NO FALLBACK,
     NO BEFORE JOURNAL,
     NO AFTER JOURNAL
     (eno INTEGER)
     PRIMARY INDEX (eno);
     *** Text of DDL statement returned.
     -------------------------------------------------------------
     CREATE VIEW "international"."view_1" AS SELECT * FROM      "international"."table_1";
     *** Text of DDL statement returned.
     -------------------------------------------------------------
     CREATE VIEW "us"."view_1" AS SELECT * FROM "us"."table_1";
     *** Text of DDL statement returned.

         -------------------------------------------------------------

     CREATE VIEW "international"."view_3" AS SELECT * FROM      "international"."view_1"."zno", "us"."view_1"."eno";

Each of the view definitions in this report is fully qualified, removing the ambiguity in Example: SHOW For a SELECT Request That Accesses Multiple Views.