ADD

You can add columns to a table only if you created the table or are specifically authorized to do so. The following example adds one column to the description of table PERS:

ALTER TABLE PERS
ADD PHONENO SMALLINT

The new column is initially filled with null values. Use the UPDATE statement to provide actual values for the new column.

In DB2, you can define a column as NOT NULL WITH DEFAULT, but you cannot define an added column to be NOT NULL.

NOT NULL WITH DEFAULT is invalid in SQL/DS.

[ Previous Page | Next Page | Contents | Index ]