These examples use the following table definition.
CREATE TABLE Pendants ( col_1 INTEGER, col_2 CHARACTER (10));
This example adds column c3, which specifies algorithmic compression, to table Pendants.
ALTER TABLE Pendants ADD col_3 CHARACTER(30) COMPRESS USING compress_udf DECOMPRESS USING decompress_udf;
This example adds column c3, which specifies algorithmic and multivalue compression, to table Pendants.
ALTER TABLE Pendants ADD col_3 CHARACTER(30) COMPRESS ('amethyst', 'amber') COMPRESS USING compress_udf DECOMPRESS USING decompress_udf;
This example changes the definition of Pendants.col_2 to add algorithmic compression. Because Pendants is empty, this ALTER TABLE request completes without error.
ALTER TABLE Pendants ADD col_2 CHARACTER(10) COMPRESS COMPRESS USING compress_udf DECOMPRESS USING decompress_udf;
This example is the same as the previous example except that a row has been added to Pendants. Because Pendants is not empty, the system returns an error to the requestor.
INSERT INTO Pendants(1, 'amber'); ALTER TABLE Pendants ADD col_2 CHARACTER(10) COMPRESS COMPRESS USING compress_udf DECOMPRESS USING decompress_udf;