Name

CREATE VIEW (Object)

Synopsis

CREATE [OR REPLACE] [FORCE | NO FORCE] VIEW
[schema.]view_name
OF
[schema.]type_name
[WITH OBJECT OID [DEFAULT | (attribute)] ]
AS viewquery
[WITH READ ONLY]
[WITH CHECK OPTION [CONSTRAINT constraint]]

Creates an object view (view_name).

Keywords

OR REPLACE

Specifies that if the view already exists, it is to be replaced.

FORCE

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

NO FORCE

Specifies that the view is to be created only if the base tables exist and the owner of the schema has privileges on them. This is the default.

OF

Specifies the object type (type_name) (and optional schema) of the view.

WITH OBJECT OID

Specifies the attributes of the object type that will be used to uniquely identified the rows in the object view. If this clause is omitted, the values default to the primary key of the base object table.

DEFAULT

Specifies that the OBJECT OID should default to the primary key of the base object view. This is equivalent to not including the WITH OBJECT OID clause at all.

attribute

List of columns in the view from which the object identifier is to be created.

AS viewquery

Any SQL SELECT statement without an ORDER BY or FOR UPDATE clause.

WITH READ ONLY

Specifies that the view cannot be used for inserts and updates.

WITH CHECK OPTION

Specifies that inserts and updates performed through the view must result in rows that the view query can select.

CONSTRAINT

Specifies a name for the CHECK OPTION constraint. The default is a system-assigned name in the form SYS_Cn, where n is an integer resulting in a unique name.

Notes

You must have the CREATE VIEW privilege to create a view in your own schema, or you must have CREATE ANY VIEW to create a view in another schema. You must have the Oracle8 Object option installed to create an object view.

The owner of the schema containing the view must have the privileges required to perform requested operations on the tables or views upon which this view is based. These privileges must be granted directly, not through a role.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset