Use the Columns page of the Create Table notebook to add columns to your
table. You can add new columns to your table and change, remove, or
rearrange the new columns. After the table is created, you must use the
Alter function to add or change columns.
Fields and controls

To add new columns:
- Click on the Columns tab.
- Click on Add. The Add Column window opens.
- In the Column name field, type a name for
the column that you're adding.
- Use the Data type box to specify the data
type of the column that you're adding.
- If you specified a data type of CHARACTER, VARCHAR, BLOB, CLOB, DBCLOB,
GRAPHIC, or VARGRAPHIC, type the length (byte count) of the column that
you're adding in the Length
field.
- If you specified a data type of BLOB, CLOB, or DBCLOB, use the LOB unit box to specify a multiplier for the
length of columns.
- If you specified a data type of DECIMAL:
- In the Precision field, type the
precision (total number of digits) for the column.
- In the Scale field, type the scale
(number of digits to the right of the decimal) for the column.
- If you specified a data type of BLOB, CLOB, DBCLOB, or a distinct type
with any of these as source types, specify the LOB options by selecting or
clearing the appropriate LOB option check
boxes.
- Optional: If you specified a data type of CHARACTER, VARCHAR, or
LONG VARCHAR, select the Bit data check box
to specify that the contents of the column be treated as bit (binary)
data.
- If you want to allow the column to contain null values, select the Nullable check box.
- Optional: If you want the column to contain a default value, select
the check box beside the Default field, and
type the default value for the column.
Note: | You cannot specify a default value if you want the column to be a generated
column.
|
- Optional: In the Comment field,
document the column that you're adding.
- If you want DB2 to automatically generate values for the column, select
Generate column contents.
- If you want the column to be an identity column, select Identity.
Note: | An identity column must have a numeric data type.
|
You can specify the following parameters:
- Initial value to specify the value that
will be generated for the first row of the table.
- Increment to specify the incremental
value for each row.
- Cache value to specify how many identity
row values DB2 will maintain in the cache.
- By default to specify whether DB2 will
generate a value for each row that you import or load into the table, even if
the input data contains an identity value for the row.
- If you want to specify the formula by which DB2 generates values, select
Formula, and specify the formula.
- Click on Add to add the new column.
- Repeat steps 3 through 13 to add another column to your table. You
can add up to 500 columns to your table.
- Click on Close to close the Add Column window.
- If you do not want to define a primary key, foreign keys, or check
constraints, click on OK to create your table and close the Create
Table notebook. Otherwise, continue on to one or more of the optional
tasks.

Related information