HP Neoview SQL Reference Manual page 104

Hide thumbs Also See for Neoview SQL:
Table of Contents

Advertisement

The SELECT statement reads rows in table t in READ UNCOMMITTED access. The same
behavior would occur with this SELECT statement:
Select * from t for read uncommitted access;
Multiple Tables in a View
Create view v as select * from t1, t2 for serializable access;
Select * from v;
The SELECT statement reads rows in tables t1 and t2 in SERIALIZABLE access. The same
behavior would occur with this SELECT statement:
select * from t1,t2 for serializable access
Explicit User-Specified Isolation Level on SELECT From a View
An explicitly-specified access option in the view definition cannot be overwritten, either by
another explicit access option in the query or by a session-level isolation setting. After the view
definition has been expanded, the isolation level that is closest to the specified table in the query
is used.
For example:
Create view v as select * from t1 for read uncommitted access;
Select * from v for serializable access;
After view expansion, the query in this example becomes:
Select * from (select * from t1 for read uncommitted access) for serializable access;
Because the isolation level closest to table t1 is READ UNCOMMITTED, READ UNCOMMITTED
is used when the rows are read.
Nested View Definitions
The semantics used with nested view definitions are the same as those described in
User-Specified Isolation Level on SELECT From a View" (page
the isolation level closest to the table is used.
For example:
Create view v as select * from t1, t2 for serializable access;
Create view v1 as select * from v for read uncommitted access;
Select * from v1;
In this example, the query becomes:
Select * from (select * from t1,t2 for serializable access)
for read uncommitted access;
Because the isolation level closest to table t1 and t2 is SERIALIZABLE access, SERIALIZABLE
access is used when the rows from those tables are read.
ORDER BY Clause Guidelines
The ORDER BY clause can be specified in the SELECT portion of a CREATE VIEW definition.
Any SELECT syntax that is valid when the SELECT portion is specified on its own is also valid
during the view definition. An ORDER BY clause can contain either the column name from the
SELECT list or from select-list-index.
When a DML statement is issued against the view, the rules documented in the following sections
are used to apply the ORDER BY clause.
When to Use ORDER BY
An ORDER BY clause is used in a view definition only when the clause is under the root of the
Select query that uses that view. If the ORDER BY clause appears in other intermediate locations
or in a subquery, it is ignored.
Consider this CREATE VIEW statement:
104
SQL Statements
104). After nested view expansion,
"Explicit

Advertisement

Table of Contents
loading

Table of Contents