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

SQL Data Definition Language Syntax and Examples

Product
Advanced SQL Engine
Teradata Database
Release Number
17.05
Published
January 2021
Language
English (United States)
Last Update
2021-01-22
dita:mapPath
ncd1596241368722.ditamap
dita:ditavalPath
hoy1596145193032.ditaval
dita:id
B035-1144
lifecycle
previous
Product Category
Teradata Vantage™

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.