SQL/MX 2.x Reference Manual (H06.04+)

SQL/MX Statements
HP NonStop SQL/MX Reference Manual540440-003
2-107
Considerations for CREATE VIEW
WITH [CASCADED] CHECK OPTION
specifies that no row can be inserted or updated in the database through the view
unless the row satisfies the view definition—that is, the search condition in the
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.
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.