Adding table columns

These steps are part of the larger tasks of creating a table and altering a table. When you complete the steps for adding columns, return to either creating a table or altering a table.



To add columns:

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

    The default column type is a nullable integer. If you want to accept this default, click Apply to create the column. Otherwise, continue with the next step.

  2. Optional: Click the Built-in Type tab and specify the column data type and any default options.
  3. Optional: In the Field procedure name field, type the name of the field procedure exit routine that you want this column to use. If you specify a field procedure, the column must be a short-string column and cannot have a non-null default value.

    A field procedure is a user-written exit routine to transform values in a single short-string column, typically to alter the sorting sequence of values entered in the column. When values in the column are changed, or new values inserted, the field procedure is invoked for each value, and can transform that value (encode it) in any way. The encoded value is then stored. When values are retrieved from the column, the field procedure is invoked for each encoded value and decodes it back to the original string values.

    You can specify a field procedure only if you did not specify a default value on the Built-in Type page.

  4. Optional: In the Field procedure parameters field, type the parameters, separated by commas, to be passed to the field procedure when it is invoked. The nth parameter specified corresponds to the nth parameter of the field procedure specified in the Field procedure name field.

    For example, to use a procedure FIELDPROC(P1,P2,P3) as the field procedure for this column, type FIELDPROC in the Field procedure field and 19,42,35 in the Field procedure parameters field. In this situation, 19, 42, and 35 correspond to P1, P2, and P3 respectively.

  5. Optional: In the Comment field, type a 1- to 254-character (including embedded blanks) comment to document the column that you're adding.
  6. Click Apply to add the new column.
  7. Repeat steps 1 through 6 to add another column to your table. You can add up to 749 columns for a table that has a referential constraint on another table, or up to 750 columns for a table that has no such constraint.
  8. Click Close to close the Add Column notebook.

Depending on the task that you were doing when you added this column, return to either creating a table or altering a table.