11.2.7 Checking whether a viewed table has been invalidated
By retrieving data from a dictionary table, you can check whether a viewed table has been invalidated. The following shows an example of retrieving data from a dictionary table.
- Example 1
-
This example checks whether viewed table CUSTOMER30s defined by HADB user ADBUSER01 has been invalidated.
Execute the following SELECT statement to make a retrieval from a dictionary table.
SELECT "IS_INVALID" FROM "MASTER"."SQL_VIEWS" WHERE "TABLE_SCHEMA"='ADBUSER01' AND "TABLE_NAME"='CUSTOMER30s'
Retrieval result
IS_INVALID ---------- Y
If the retrieval result is Y, CUSTOMER30s has been invalidated.
If the retrieval result is a null value, CUSTOMER30s has not been invalidated.
- Example 2
-
Of the viewed tables defined by HADB user ADBUSER01, this example displays the list of invalidated viewed tables.
SELECT "TABLE_NAME" FROM "MASTER"."SQL_VIEWS" WHERE "TABLE_SCHEMA"='ADBUSER01' AND "IS_INVALID"='Y'
Retrieval result
TABLE_NAME ----------- CUSTOMER30s CUSTOMER40s CUSTOMER50s
In the retrieval result, a list of invalidated viewed tables is displayed.