Hitachi

Hitachi Advanced Database Setup and Operation Guide


11.2.11 Checking dependent viewed tables

By retrieving data from a dictionary table, you can check dependent viewed tables. The following shows an example of retrieving data from a dictionary table.

Example:

This example checks the viewed tables that depend on the CUSTOMER table defined by HADB user ADBUSER01.

Execute the following SELECT statement to make a retrieval from a dictionary table.

SELECT "MV"."TABLE_SCHEMA","MV"."TABLE_NAME"
    FROM  "MASTER"."SQL_VIEW_TABLE_USAGE" "MVU"
         ,"MASTER"."SQL_VIEWS" "MV"
      WHERE "MVU"."TABLE_SCHEMA"='ADBUSER01'
        AND "MVU"."TABLE_NAME" = 'CUSTOMER'
        AND "MV"."TABLE_SCHEMA" = "MVU"."VIEW_SCHEMA"
        AND "MV"."TABLE_NAME" = "MVU"."VIEW_NAME"

Retrieval result

TABLE_SCHEMA TABLE_NAME
------------ ----------
ADBUSER01    CUSTOMER30s
ADBUSER01    CUSTOMER40s
ADBUSER02    CUSTOMER90s

In the retrieval result, a list of dependent viewed tables is displayed.