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-36
Dropping Triggers
4. Enter the DROP TABLE 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 and examples of dropping tables, see the SQL/MX Reference
Manual.
Recovering SQL/MX Tables Dropped Accidentally
If you drop a table accidentally, you can recover the table using the DDL file generated
automatically by NonStop SQL/MX. For more information, see Using TMF to Recover
Dropped SQL/MX Objects on page 5-20 and Recovering Tables on page 12-8.
Dropping SQL/MX Table Data Only
To drop data from a table while leaving the table intact, use the PURGEDATA utility.
PURGEDATA drops all data from both tables and their related indexes, or from specific
partitions of tables that have no indexes.
Guidelines for Dropping Table Data Only
•
To use PURGEDATA, you must have ALL privileges on the table you specify
(DELETE, INSERT, SELECT, and UPDATE) and you must own the schema, or you
must be the super ID.
•
If PURGEDATA fails in response to a process, CPU, or system error, it uses the
RECOVER utility to recover the operation. If the PURGEDATA operation cannot be
canceled, RECOVER returns an error.
For more information about the PURGEDATA utility, see Using PURGEDATA to Delete
Data From Tables on page 10-45 and the SQL/MX Reference Manual.
Steps for Dropping a Table’s Data Only
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 containing the data you wish to drop.
3. Use the PURGEDATA utility to drop the data.
4. Make new TMF online dumps of all affected partitions.
For more information and examples of dropping only the data from a table, see the
SQL/MX Reference Manual.
Dropping Triggers
To drop a trigger from an SQL/MX table, use the DROP TRIGGER statement.










