ODBC Server Reference Manual
Transact-SQL Language
HP NonStop ODBC Server Reference Manual—429151-002
4-59
Examples
Tables in the query-specification must be in the current database or be
qualified by their database name.
If there is only one table referenced by the view, NonStop ODBC automatically
creates a protection view.
The query-specification cannot include the ORDER BY clause, but it can
include the OUTER JOIN and UNION clauses.
See SELECT on page 3-54 for further information.
Examples
The following statement creates a view called MGRLIST on the disk volume DISK01
on the node TEST:
use test_disk01_persnl
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
PERSNL database.
The MGRLIST view definition will be recorded in the PERSNL NonStop SQL/MP
catalog on the disk volume DISK01 on the node called TEST.
NonStop ODBC Server Compared With SQL Server
When used through the NonStop ODBC Server, CREATE VIEW differs from the SQL
Server implementation in the following ways:
Feature In SQL Server
In Programs Used With the NonStop
ODBC Server
Can CREATE VIEW be
inside a transaction?
No Yes
See DDL Statements Allowed in User-
Defined Transactions on page 4-3.
Can you modify data in
a view?
Yes, with some
restrictions.
Yes, if the view is a protection view.
See the following discussion of “Shorthand
Views and Protection Views.”
Can you select columns
from several
databases?
Yes Yes, as long as the NonStop SQL/MP
catalogs of all the databases are
customized.