ODBC Server Reference Manual
CORE SQL Language
HP NonStop ODBC Server Reference Manual—429151-002
3-44
Examples
The query-specification cannot include the ORDER BY clause, but it can
include the OUTER JOIN and UNION clauses.
For more information, see SELECT on page 3-54.
Examples
The following statement creates a view called MGRLIST:
create view mgrlist
(first_name,
last_name,
department)
as select first_name,
last_name,
deptname
from dept,
employee
where dept.manager = employee.empnum
This view includes columns from the DEPT table and the EMPLOYEE table of the
current database.
The following statement creates a single view from all of the columns in the TAB1 and
TAB2 tables.
create view view1
as select *
from tab1
union select *
from tab2
Shorthand Views and Protection Views
NonStop SQL/MP has two types of views:
When you create a view using the NonStop ODBC Server, the NonStop ODBC Server
attempts to create a protection view. If the create fails, however, the NonStop ODBC
Server creates a shorthand view. The NonStop ODBC Server returns an informational
message in this case.
Shorthan
d
Derived from one or more tables or other views and defined without the
protection attribute.
A shorthand view can be read but not updated.
Protection Derived from a single table by taking a projection of the columns of the
table, or a selection of the rows of the table, or both. For more
information about the rules for protection views, see CREATE VIEW in
the NonStop SQL/MP Reference Manual.
A protection view can be secured, updated, and read, with certain
restrictions; see the NonStop SQL/MP Reference Manual.