Considerations For Create View - HP Neoview SQL Reference Manual

Hide thumbs Also See for Neoview SQL:
Table of Contents

Advertisement

Considerations for CREATE VIEW

You can specify GROUP BY using ordinals to refer to the relative position within the SELECT
list. For example, GROUP BY 3, 2, 1.
Dynamic parameters are not allowed.
Reserved View Names
View names prefixed by the name of a user metadata table are reserved. You cannot create views
with such names. For example, you cannot create views that are prefixed by these names:
HISTOGRAMS
HISTOGRAM_INTERVALS
MVS_UMD
MVS_TABLE_INFO_UMD
MVS_USED_UMD
Effect of Adding a Column on View Definitions
The addition of a column to a table has no effect on any existing view definitions or conditions
included in constraint definitions. Any implicit column references specified by SELECT * in view
or constraint definitions are replaced by explicit column references when the definition clauses
are originally evaluated.
Authorization and Availability Requirements
To create a view, you must have select privileges for the objects underlying the view, be the
owner of the schemas in the view, be the owner of the objects in the view, or have CREATE or
CREATE_VIEW privilege on the schema in the view.
When you create a view on a single table, the owner of the view is automatically given all
privileges WITH GRANT OPTION on the view. However, when you create a view that spans
multiple tables, the owner of the view is given only SELECT privileges WITH GRANT OPTION.
If you try to grant privileges to another user on the view other than SELECT you will receive a
warning that you lack the grant option on that privilege.
Updatable and Non-Updatable Views
Single table views can be updatable. Multi-table views cannot be updatable.
To define an updatable view, a query expression must also meet these requirements:
It cannot contain a JOIN, UNION, or EXCEPT clause.
It cannot contain a GROUP BY or HAVING clause.
It cannot directly contain the keyword DISTINCT.
The FROM clause must refer to exactly one table or one updatable view.
It cannot contain a WHERE clause that contains a subquery.
The select list cannot include expressions or functions or duplicate column names.
Isolation Level Guidelines
The isolation level specified in the CREATE VIEW SELECT statement is implemented when the
view is used in a DML statement.
For descriptions of these four access options, see
(page
25).
Single Table in a View
Create view v as select * from t for read uncommitted access;
Select * from v;
"Data Consistency and Access Options"
CREATE VIEW Statement
103

Advertisement

Table of Contents
loading

Table of Contents