SQL/MP Installation and Management Guide
Creating a Database
HP NonStop SQL/MP Installation and Management Guide—523353-004
5-40
Creating a Shorthand View
Creating a Shorthand View
A shorthand view is a view derived from one or more tables and other views and
defined without the PROTECTION attribute. A shorthand view can only be queried and
it can be secured only for purge access. Any user who has authority to read the
underlying table or tables, has authority to read the shorthand view.
Security Guidelines for Shorthand Views
•
A shorthand view can have more than one underlying table or view or a
combination of underlying tables and views.
•
The view’s creator must have authority to write to the VIEWS catalog table that
contains the view description and to the USAGES and TRANSIDS catalog tables in
the catalogs that contain the descriptions of the underlying tables and views.
•
The owner of a shorthand view is set to that of the creator. The security string
defaults to the current default security of the creating process. You can specify a
security string in the SECURE clause of the CREATE VIEW statement.
•
The owner of a shorthand view does not have to be the same as the owner of an
underlying table or view. Different users can own the tables and views underlying a
shorthand view.
•
Only purge authority has meaning in the security string for a shorthand view,
although the entire string is required. Anyone with authority to read all the
underlying tables has authority to read a shorthand view. When you create a
shorthand view, you should verify that read authority is available for all the
underlying tables and views.
Examples
This example creates a shorthand view of two tables by using the DEPTNUM columns
in the joining criterion. Correlation names are required because DEPTNUM appears in
both tables.
>> CREATE VIEW \SYS1.$VOL1.PERSNL.EMPDEPT
+> AS SELECT E.EMPNUM, E.LAST_NAME, E.FIRST_NAME,
+> E.DEPTNUM, D.DEPTNAME
+> FROM \SYS1.$VOL1.PERSNL.EMPLOYEE E,
+> \SYS1.$VOL1.PERSNL.DEPT D
+> WHERE E.DEPTNUM = D.DEPTNUM
+> CATALOG \SYS1.$VOL1.PERSNL;
Example 5-2 on page 5-41 creates a shorthand view of four joined tables. Correlation
names are required because of duplicate column names in the tables. The INFO
DEFINE command displays the DEFINEs used in creating the view. For more
information about DEFINEs, see Using DEFINEs on page 10-30.