SQL/MP Installation and Management Guide

Adding, Altering, Removing, and Renaming
Database Objects
HP NonStop SQL/MP Installation and Management Guide523353-004
7-34
Dropping Constraints
Dropping Constraints
Dropping constraints on the database is similar to making a program change. Any
future data inserts or updates will not have to satisfy the constraint. The DROP
CONSTRAINT statement drops only the constraint definition from the catalog and does
not affect the data in the table.
Dropping a constraint on a table invalidates the programs that depend on the table.
You should include steps to explicitly SQL compile the dependent programs to avoid
automatic recompilation and to return the application to a valid state.
To drop a constraint, 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 table for which you want to drop the constraint.
3. Determine which programs depend on the table by using the DISPLAY USE OF
command. These programs will be invalidated.
4. Optionally, prevent the use of the table for the duration of the DROP CONSTRAINT
operation to eliminate conflicts in access to the table; this operation requires
exclusive use of the table.
5. Enter the DROP CONSTRAINT statement.
6. SQL compile the invalidated programs identified by the DISPLAY USE OF
command in Step 3.
7. Restart use of the table if you stopped its use.
Dropping Collations
To drop a collation, use the DROP COLLATION statement. This statement drops the
collation only if no objects or programs depend on it.
To drop a collation, you must own the collation and have authority to read and write to
the catalog in which the collation is registered. 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 all the objects and programs dependent on the collation by using the
DISPLAY USE OF command.
3. Drop any dependent objects and programs.
4. Enter the DROP COLLATION statement.