Adding columns when altering a table

Use the Add Column window to add columns to your table. You can add multiple columns before closing this window.

Fields and controls

Authorities and privileges



To add new columns:

  1. In the Column name field, type a name for the column that you're adding.

  2. Use the Data type box to specify the data type of the column that you're adding.

  3. 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.

  4. 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.

  5. If you specified a data type of DECIMAL:

    1. In the Precision field, type the precision (total number of digits) for the column.

    2. In the Scale field, type the scale (number of digits to the right of the decimal) for the column.

  6. 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.

  7. 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.

  8. Optional: In the Default field, type a default value for the column.

  9. If you want to allow the column to contain null values, select the Nullable check box.

  10. Optional: In the Comment field, document the column that you're adding.

  11. Click on Add to add the new column.

  12. Repeat steps 1 through 11 to add another column to your table. You can add up to 500 columns to your table.

  13. Click on Close to close the Add Column window.

  14. If you do not want to make any additional changes to the table, click on OK to alter your table and close the Alter Table notebook. Otherwise, continue on to one or more of the optional tasks.


Related information