The column attribute change definition (CHANGE column-name) of the ALTER TABLE definition SQL statement cannot be used to change the definition of a compressed column. To change the definition of a compressed column, such as removing the compression specification or changing the split compression size, you must use the procedure below.
To change the definition of a compressed column:
- Unload the compressed table.
Unload the compressed table whose definition is to be changed.
- Redefine the table.
Use one of the following methods to redefine a table whose compression specification has been changed or removed:
- Redefining the table
Use DROP TABLE to delete the compressed table and then use CREATE TABLE to redefine the table whose compression specification was changed or removed.
- Deleting and adding columns
Use PURGE TABLE to remove all data from the table and then use the column deletion definition (DROP column-name) of ALTER TABLE to delete the compressed column. Next, use the column addition definition (ADD column-name) of ALTER TABLE to add the column whose compression specification was changed or removed.
Note that the column addition definition of ALTER TABLE adds a column at the end of a table. Therefore, the compression specification can be changed or removed only for the last column.
- Reload the table
Reload the unload data file that was unloaded in step 1 to the table that was defined in step 2.
For details about unloading and reloading data, see the manual HiRDB Version 9 Command Reference.