Name

CREATE/ALTER/DROP VIEW

Synopsis

CREATE Syntax:

CREATE [OR REPLACE] [[NO] FORCE] VIEW [schema.]view_name
[ { ( { alias [Column_Constraint_Clause [Column_Constraint_Clause]...] 
      | Table_Constraint_Clause } [,[Table_Constraint_Clause]... ]
      } )
  | OF [schema.] type_name 
    { WITH OBJECT IDENTIFIER { DEFAULT | (attribute [,attribute]...)}
    | UNDER [schema.] superview
    }
    ( { Table_Constraint_Clause 
      | attribute Table_Constraint_Clause [Table_Constraint_Clause...]
      })
  | OF XMLTYPE   
    [[XMLSCHEMA XML_Schema_URL] ELEMENT {element | XML_Schema_URL#element] 
    WITH OBJECT IDENTIFIER {(expr[,expr...]) | DEFAULT}

  }]
AS viewquery [WITH 
 {READ ONLY 
 | CHECK OPTION [CONSTRAINT constraint_name]
 }]

ALTER Syntax:

ALTER VIEW [schema .] view_name 
{ADD Table_Constraint_Clause 
| MODIFY CONSTRAINT Table_Constraint_Clause {RELY | NORELY} 
| DROP {CONSTRAINT constraint_name | PRIMARY KEY | UNIQUE (column[,column]... )} 
| COMPILE
}

DROP Syntax:

DROP VIEW [schema.view_name]

Creates, modifies, or removes a view.

The ALTER VIEW statement explicitly recompiles a view. We recommend that you issue it after making changes to any of the view’s underlying base tables.

Keywords

Table_Constraint_Clause

May be included in the CREATE/ALTER VIEW statement beginning in Oracle9i. See the discussion under Section 7.1 for more information.

FORCE

Specifies that the view be created regardless of whether the view’s base tables exist or whether the owner of the schema has privileges on them.

NOFORCE

Specifies that the view be created only if the ...

Get Oracle in a Nutshell now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.