SQL/MX 2.x Reference Manual (G06.24+, H06.03+)
SQL/MX Language Elements
HP NonStop SQL/MX Reference Manual—523725-004
6-112
SQL/MX Views
An view is a logical table created with the CREATE VIEW statement and derived by
projecting a subset of columns, restricting a subset of rows, or both, from one or more
base tables or other views.
You cannot create a view that references both an SQL/MP table and an SQL/MX table.
SQL/MX Views
The distinction between protection and shorthand views does not exist for SQL/MX
views. To create a view, you must have SELECT privileges for the objects underlying
the view.
A view’s name must be unique among table and view names within the schema that
contains it. You cannot create views with names prefixed by the name of a user
metadata table. For example, you cannot create a view named
HISTOGRAMS_MYVIEW.
Single table views are updatable. Multitable views are not updatable.
For information about SQL/MX views, see CREATE VIEW Statement on page 2-105
and DROP VIEW Statement on page 2-133.
SQL/MP Views
SQL/MP views are either protection views or shorthand views. A protection view is
derived from a single table and can be read, updated, and secured. A shorthand view
is derived from one or more tables or other views and inherits the security of the
underlying tables. A shorthand view can be read but not updated.
A view name must be a Guardian name.
For retrieval, all views can be used like base tables. Whether a view can be used in an
insert, update, or delete operation depends on its definition.
For information about SQL/MP views, see Views in the SQL/MP Reference Manual.
Example of a View
A view can be defined to show only part of the data in a table. For example, this
EMPLIST view is defined as part of the EMPLOYEE table in the sample database:
In this sample view, the columns are EMPNUM, FIRST_NAME, LAST_NAME,
DEPTNUM, and JOBCODE. The SALARY column in the EMPLOYEE table is not part
of the EMPLIST view.
EMPNUM FIRST_NAME LAST_NAME DEPTNUM JOBCODE
1 ROGER GREEN 9000 100
23 JERRY HOWARD 1000 100
75 TIM WALKER 3000 300
. . . . . . . . . . . . . . .