SQL/MX 2.x Installation and Management Guide (H06.10+, J06.03+)
Adding, Altering, and Dropping SQL/MX Database
Objects
HP NonStop SQL/MX Installation and Management Guide—544536-007
9-23
Altering SQL/MX Tables
4. Use the DISPLAY USE OF command to identify which user modules are
associated with this object. See the similarity check criteria in the SQL/MX
Programming Manual for C and COBOL to determine if your changes are likely to
cause similarly check to fail and force automatic recompilation. If they will, you
should SQL compile these modules after making the changes to avoid expensive
automatic recompilations at run time. SQL applications that are running while you
make these changes will still undergo automatic recompilation.
For information about explicit and automatic recompilation, see the SQL/MX
Programming Manual for C and COBOL. For information about using DISPLAY
USE OF, see Checking Module Dependencies with DISPLAY USE OF on
page 11-19 and the SQL/MX Reference Manual.
5. Enter the CREATE TABLE statement to create a new table definition that contains
the new column attributes.
6. After creating the new table, load the old table’s data into the new table with
INSERT/SELECT statements.
7. After the loading the new table, drop the old table.
8. Revise the application source code as needed to reflect your changes to the
database. Process and compile the updated source file. For more information, see
the SQL/MX Programming Manual for C and COBOL.
Adding Table Columns
See Adding Columns to an SQL/MX Table on page 9-5.
Dropping Table Columns
See Dropping Columns from an SQL/MX Table on page 9-28.
Altering Table Constraints
You cannot alter constraints, but you can change them by dropping an existing
constraint or by adding a new constraint to the table. Constraints reside in definition
only; therefore, they have no physical or security attributes to alter.
Adding a Table Constraint
See Adding Constraints on page 9-7.
Dropping a Table Constraint
See Dropping Constraints on page 9-29.
Altering Table File Attributes
To alter these physical file attributes of SQL/MX tables, use the ALTER TABLE
statement:










