Supplement to the HP Neoview SQL Reference Manual (R2.3 SP2)

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 “Explicit
User-Specified Isolation Level on SELECT From a View” (page 14). After nested view expansion,
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.
ORDER BY Syntax
When you specify an ORDER BY clause:
Create view V as select ... order-by-clause
theorder-by-clause syntax is:
order by [column-list | select-index-list]
For more information about SELECT statement command syntax, see the Neoview SQL Reference
Manual.
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:
Create view v as select a from t order by a;
Select * from v x, v y;
14 CREATE VIEW Enhancements