11.2.10 Checking the underlying tables of a viewed table
By retrieving data from a dictionary table, you can check the underlying tables of a viewed table. The following shows an example of retrieving data from a dictionary table.
- Example:
-
This example checks the underlying tables of viewed table CUSTOMER30s defined by HADB user ADBUSER01.
Execute the following SELECT statement to make a retrieval from a dictionary table:
SELECT "MVU"."TABLE_SCHEMA","MVU"."TABLE_NAME" FROM "MASTER"."SQL_VIEW_TABLE_USAGE" "MVU" WHERE "MVU"."VIEW_SCHEMA"='ADBUSER01' AND "MVU"."VIEW_NAME" = 'CUSTOMER30s' AND "MVU"."IS_DIRECT" ='Y'
Retrieval result
TABLE_SCHEMA TABLE_NAME ------------ ---------- ADBUSER01 CUSTOMER ADBUSER01 STOCK
This retrieval result shows that the underlying tables of CUSTOMER30s are the CUSTOMER and STOCK tables owned by ADBUSER01.