SQL/MP Installation and Management Guide
Adding, Altering, Removing, and Renaming
Database Objects
HP NonStop SQL/MP Installation and Management Guide—523353-004
7-18
Altering View Attributes
Altering View Attributes
You can alter the security string specification of a view but not the attributes. You can
alter the owner ID for a shorthand view but not for a protection view. To alter the
security or owner ID, use the ALTER VIEW statement.
Altering a view’s security neither invalidates any programs nor affects the dependent
views. If you alter the security of the view, however, you might damage the security
scheme of the dependent views and the access strategy. You can alter the security of a
view by using the ALTER VIEW statement or the SECURE command. For a detailed
description of view security dependencies, see the description of the ALTER VIEW
statement in the SQL/MP Reference Manual.
This example alters the security attributes of a shorthand view:
>> ALTER VIEW $VOL1.PERSNL.NAMELIST OWNER 100,001
+> SECURE "NNNO";
--- SQL operation complete.
You can create a view that inherits the heading text or help text from the underlying
table. Alternatively, you can create new headings and help text for the columns of the
view. After the view is created, you can also alter the heading text or help text as an
independent operation.
To add or alter the heading text for a column, use the ALTER VIEW statement. To add
or alter help text for a column, use the HELP TEXT statement. Altering the heading text
or help text of the columns in the underlying table does not alter the heading text or
help text inherited by the view.
Use the ALTER VIEW statement with the SIMILARITY CHECK ENABLE clause to
enable similarity checking for a protection view.
This example demonstrates altering the heading text for the column EMPNUM of the
EMPLIST view. If the column did not previously have a heading, the new heading is
added. If the column already had a heading, the old heading is replaced by the new
one.
>> ALTER VIEW $VOL1.PERSNL.EMPLIST COLUMN EMPNUM
+> HEADING "Employee ID Number";
--- SQL operation complete.
To alter a view, follow these steps:
1. Start an SQLCI session. Enter a LOG command to initiate a log file for the
statements and commands entered in this session. Keep the log for your records.
2. Determine the name of the view you want to alter and the name of the table that
underlies the view.
3. Determine whether the change meets the security dependencies of dependent
views.
4. Enter the ALTER VIEW statement.