Skip to Main Content
Oracle in a Nutshell
book

Oracle in a Nutshell

by Rick Greenwald, David C. Kreines
December 2002
Intermediate to advanced content levelIntermediate to advanced
928 pages
85h 29m
English
O'Reilly Media, Inc.
Content preview from Oracle in a Nutshell

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 ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Oracle Internals

Oracle Internals

Donald K. Burleson
Oracle PL/SQL

Oracle PL/SQL

Lewis Cunningham
Oracle Essentials: Oracle9i, Oracle8i and Oracle8, Second Edition

Oracle Essentials: Oracle9i, Oracle8i and Oracle8, Second Edition

Rick Greenwald, Robert Stackowiak, Jonathan Stern

Publisher Resources

ISBN: 0596003366Errata Page