SQL/MP Installation and Management Guide

Adding, Altering, Removing, and Renaming
Database Objects
HP NonStop SQL/MP Installation and Management Guide523353-004
7-27
Altering Constraints
For more information about column attributes, see Defining Columns on page 5-19.
Altering Constraints
You cannot alter constraints, but you can change them by dropping an existing
constraint or adding a new constraint to the table. Constraints reside in definition only;
therefore, they have no physical or security attributes to alter.
Altering Collation Attributes
You can alter the collation’s owner or security string by using the ALTER COLLATION
statement. To alter a collation, you must have authority to read and write to the
collation and the catalog in which the collation is registered.
Example 7-1. Altering a Column
* Record Definition for $VOL1.SALES.ORDERS
01 ORDERS.
02 ORDERNUM PIC 9(6).
02 ORDER_DATE PIC S9(6) COMP.
02 DELIV_DATE PIC S9(6) COMP.
02 SALESREP PIC 9(4).
02 CUST_PO PIC X(35).
02 CUSTNUM PIC 9(4).
>> LOG $VOL1.DBCHANGE.CNGLOG;
>> CREATE TABLE $VOL1.SALES.ZZORDERS
+> (ORDERNUM PIC 9(6) NO DEFAULT NOT NULL,
+> ORDER_DATE PIC S9(6) COMP DEFAULT SYSTEM NOT
NULL,
+> DELIV_DATE PIC S9(6) COMP DEFAULT SYSTEM NOT
NULL,
+> SALESREP PIC 9(4) DEFAULT SYSTEM,
+> CUST_PO PIC X(45) DEFAULT SYSTEM NOT NULL,
+> CUSTNUM PIC 9(4) DEFAULT SYSTEM NOT NULL,
+> PRIMARY KEY ORDERNUM)
+> EXTENT (1000,100)
+> CATALOG $VOL1.SALES;
--- SQL operation complete.
>> ALTER TABLE $VOL1.SALES.ZZORDERS NO AUDIT;
--- SQL operation complete.
>> LOAD $VOL1.SALES.ORDERS, $VOL1.SALES.ZZORDERS,
+> MOVEBYNAME;
--- SQL operation complete.
>> ALTER TABLE $VOL1.SALES.ZZORDERS AUDIT;
--- SQL operation complete.
Caution. Altering the security of a collation might restrict access to objects and programs that
use the collation.