Introduction to NonStop SQL/MP

Using Views
How to Use NonStop SQL
113425 Tandem Computers Incorporated 2–7
Protection Views NonStop SQL/MP provides another type of view, the protection view, for security and
privacy. A protection view provides column-level security by restricting access to
individual columns.
Consider, for example, the salary information in the EMPLOYEE table. You can
prevent unauthorized users from seeing employee salaries by securing the table to
prevent access to the SALARY column. For general users, you can create a protection
view of the EMPLOYEE table without salary information. You can secure the view so
that general users can retrieve and update data in the view columns. Only users with
access to the underlying table can view or update the SALARY column.
Figure 2-5 illustrates a protection view.
Figure 2-5. A Protection View
008
EMPPUB View
ROGER
JERRY
JANE
•••
•••
BEN
JESSICA
GREEN
HOWARD
RAYMOND
•••
•••
HENDERSON
CRINER
9000
1000
3000
•••
•••
5000
3500
FIRST LAST DEPTNUM
Retrieves data from the
table through the view.
Only one table allowed.
Specifies protection view.
CREATE VIEW EMPPUB (EMPNUM, FIRST, LAST, DEPTNUM,
JOBCODE)
AS SELECT EMPNUM, FIRST_NAME, LAST_NAME,
DEPTNUM, JOBCODE
FROM EMPLOYEE
FOR PROTECTION ;
SELECT FIRST, LAST, DEPTNUM FROM EMPPUB ;
Suppose a user who has access to the EMPPUB protection view, but not to the
underlying table, issues the following query:
SELECT FIRST, LAST, SALARY
FROM EMPPUB ;
NonStop SQL/MP returns an error message explaining that the SALARY column does
not exist.