Hitachi

Hitachi Advanced Database Setup and Operation Guide


11.2.5 Deleting a viewed table

To delete a viewed table, execute the DROP VIEW definition SQL statement.

A user (the HADB user with the authorization identifier that was used for the current connection to the HADB server) can delete only those viewed tables owned by that user. A user cannot delete viewed tables owned by other HADB users.

Important

If you delete a viewed table, all viewed tables that depend on it are deleted (or invalidated). Therefore, before you delete a viewed table, check whether there are viewed tables that depend on it, and make sure that there is no problem if those viewed tables are deleted or invalidated.

The following shows an example of deleting a viewed table.

Example

The following procedure deletes the CUSTOMER30s table defined in 11.2.1 Defining a viewed table.

Procedure:

  1. Check the viewed tables that depend on CUSTOMER30s.

    By retrieving data from a dictionary table, you can check the viewed tables that depend on the viewed table to be deleted. For an example of retrieving data from a dictionary table, see 11.2.11 Checking dependent viewed tables.

  2. Execute the DROP VIEW statement to delete CUSTOMER30s.

    DROP VIEW "CUSTOMER30s" CASCADE
    Note

    In the preceding example, CASCADE is specified for the drop behavior. Therefore, all viewed tables that depend on the viewed table to be deleted (CUSTOMER30s) are deleted. If you omit specifying the drop behavior, all viewed tables that depend on the viewed table to be deleted are invalidated.