SQL/MP Installation and Management Guide

Adding, Altering, Removing, and Renaming
Database Objects
HP NonStop SQL/MP Installation and Management Guide523353-004
7-16
Altering Table Attributes
strategy. If you alter the audit flag, you can invalidate the most recent TMF online
dump, and programs expecting an audited table will receive a TMF run-time error.
You can alter a single partition of a partitioned table by specifying the PARTONLY
clause in the ALTER statement. For a partitioned table, if you omit PARTONLY, the
statement operates on all partitions, and all partitions must be accessible.
These examples demonstrate altering the security and file attributes of a table:
>> ALTER TABLE $VOL1.PERSNL.EMPLOYEE OWNER 100,001
+> SECURE "NGOO";
--- SQL operation complete.
>> ALTER TABLE $VOL1.SALES.ORDERS MAXEXTENTS 300;
--- SQL operation complete.
>> ALTER TABLE $VOL1.SALES.CUSTOMER NOPURGEUNTIL DEC 31 1990;
--- SQL operation complete.
Use the ALTER TABLE statement with the COLUMN specification to add or change
heading text for an existing column of a table. Use the HELP TEXT statement to add or
change help text for a column. It is not possible to alter the other attributes or the data
type of a column.
Use the ALTER TABLE statement with the SIMILARITY CHECK ENABLE clause to
enable similarity checking for a table.
This example shows how to alter the heading text for the column EMPNUM of the
EMPLOYEE table. If the column did not previously have a heading, the new heading is
added. If the column previously had a heading, the old heading is replaced by the new
one.
>> ALTER TABLE $VOL1.PERSNL.EMPLOYEE COLUMN EMPNUM
+> HEADING "Employee ID Number";
--- SQL operation complete.
Specifying NO HEADING in the ALTER TABLE COLUMN statement deletes any
existing heading text from the column.
Altering the heading text for a table column does not update any dependent views
created with the headings of the underlying table columns. To keep the two objects
synchronized, you must update the view’s column headings independently.
You can also alter the partition array type associated with a table. If you change the
array type, all programs that refer to the table are invalidated. In addition, if you modify
the type from EXTENDED to STANDARD, the data structures might not fit within the
STANDARD format. When this situation occurs, SQL returns an error.