Previous Topic: Table Management StatementsNext Topic: Define a New Table to the Product


Add Table Columns

To add a column to a table, use the ALTER TABLE statement.

Suppose the APPLICATIONS table needs a column added to it called RET_CODE, which holds a return code for the last execution of the application. To add this column, issue this command:

OPSQL ALTER TABLE APPLICATIONS ADD COLUMN RET_CODE CHAR(2)

This example uses a CHAR (character) data type definition, specifying that the column being added is 2 characters in width. Other valid data types for columns include integer, small integer, decimal, hexadecimal, date, time, and time stamp.