Dropping a View

From InterBase

Go Up to Dropping Metadata


To delete a view, use DROP VIEW. A view can only be dropped by its owner, the SYSDBA, or a user with root privileges. If a view is in use when a drop is attempted, the drop is postponed until the view is no longer in use. The syntax of DROP VIEW is:

EXEC SQL
DROP VIEW name;

The following statement drops the EMPLOYEE_SALARY view:

EXEC SQL
DROP VIEW EMPLOYEE_SALARY;
EXEC SQL
COMMIT;

Deleting a view fails if a view is used in another view, a trigger, or a computed column. To delete a view that meets any of these conditions:

  1. Delete the other view, trigger, or computed column.
  2. Delete the view.

For more information about DROP VIEW, see the Data Definition Guide.

Advance To: