This statement is an extension to the ANSI/ISO standard for SQL.
.-CASCADE--. >>-DROP VIEW--+------------+--+-view----+--+-RESTRICT-+-------->< '- owner-- .-' '-synonym-'
Element | Description | Restrictions | Syntax |
---|---|---|---|
owner | Name of view owner | Must own the view | Owner Name |
synonym | Synonym for a view that this statement drops | The synonym and the view to which it points must exist in the local database | Identifier |
view | Name of a view to drop | Must exist in systables | Identifier |
To drop a view, you must be the owner or have the DBA privilege.
When you drop a view, you also drop any other views and INSTEAD OF triggers whose definitions depend on that view. (You can also specify this default behavior explicitly with the CASCADE keyword.)
When you include the RESTRICT keyword in the DROP VIEW statement, the drop operation fails if any other existing views are defined on view; otherwise, these dependent views would be unregistered by the DROP VIEW operation.
You can query the sysdepend system catalog table to determine which views, if any, depend on another view.
The following statement drops the view that is named cust1:
DROP VIEW cust1
Related statements: CREATE VIEW and DROP TABLE
For a discussion of views, see the IBM Informix Guide to SQL: Tutorial.