SQL/MX 3.2 Management Manual (H06.25+, J06.14+)

Table Of Contents
statement drops only the constraint definition from the table 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.
For more information, see the SQL/MX Reference Manual.
Steps for Dropping a Constraint
1. Start an MXCI session. Enter a LOG command to initiate a log file for 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. 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 more information about explicit and automatic recompilation, see the SQL/MX Programming
Manual for C and COBOL. For more information about using DISPLAY USE OF, see “Checking
Module Dependencies with DISPLAY USE OF” (page 223) and the SQL/MX Reference Manual.
4. Enter the ALTER TABLE DROP CONSTRAINT statement.
5. 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.
For more information, see the SQL/MX Reference Manual.
Dropping SQL/MX Indexes
To drop an index, use the DROP INDEX statement.
This statement purges the physical file that contains the index and eliminates the access path to
the underlying table. The RESTRICT option, by default, will not allow an index to be dropped if it
is being used to validate a constraint. The CASCADE option, if specified, will drop both the index
and any constraints using the index for validation.
Dropping an index invalidates programs that depend on index access path. When you drop an
index, you should explicitly SQL compile the dependent programs to return the application to a
valid state and to avoid expensive automatic recompilations.
For more information, see the SQL/MX Reference Manual.
Steps for Dropping an Index
1. Start an MXCI session. Enter a LOG command to initiate a log file for 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 index.
3. 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 more information about explicit and automatic recompilation, see the SQL/MX Programming
Manual for C and COBOL. For more information about using DISPLAY USE OF, see “Checking
Module Dependencies with DISPLAY USE OF” (page 223) and the SQL/MX Reference Manual.
Dropping Objects From an SQL/MX Database 169