SQL/MX 2.x Reference Manual (G06.24+, H06.03+)
SQL/MX Statements
HP NonStop SQL/MX Reference Manual—523725-004
2-108
Considerations for CREATE VIEW
WHERE clause of the query expression must evaluate to TRUE for any row that is
inserted or updated.
If you omit this option, a newly inserted row or an updated row need not satisfy the
view definition, which means that such a row can be inserted or updated in the
table but does not appear in the view. This check is performed each time a row is
inserted or updated.
WITH CHECK OPTION does not affect the query expression; rows must always
satisfy the view definition. CASCADED is an optional keyword; WITH CHECK
OPTION has the same effect.
Considerations for CREATE VIEW
You cannot create a view that references both an SQL/MP table and an SQL/MX table.
Reserved View Names
View names prefixed by the name of a UMD table are reserved. You cannot create
views with such names. For example, you cannot create a view named
HISTOGRAMS_MYVIEW.
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.
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.