Previous Topic: Add a New TableNext Topic: Modify Table or Column


Add a Column

Use the Schema Designer to add a column in the database.

Follow these steps:

  1. Select the table for which you want to add a column (or select any of its existing columns).
  2. Select Edit, Add Column.

    The Add New Column dialog opens.

  3. Enter the column name in the New Column Name field and click OK. Ensure that you begin the names of a column with the letter z to prevent conflict with possible future standard columns.

    WSP verifies that you added the prefix, but adds a z to the beginning of the column name if necessary.

  4. Complete the following fields as appropriate:
    Name

    (Display-only) Specifies the object name of the column. For example, the object name of the Contact alt_phone column is alt_phone.

    Display Name

    Specifies the user-friendly name of the column. You can change the Display Name of a column by entering another name in this field. For example, the display name of the Contact alt_phone column is alternative phone.

    Schema Name

    (Read-only for standard tables) Specifies the name used to refer to the column in CA SDM utilities, such as pdm_userload. For site-defined tables, Schema Name defaults to the Object Name. You can change the Schema Name by entering another value in this field.

    DBMS Name

    (Read-only for all tables) Specifies the name used to refer to the table in the physical DBMS. For site-defined tables, the DBMS Name equals the same as Schema Name.

    Description

    Provides a brief description of the column.

    Field Type

    (Read-only for all standard columns in standard tables, and saved site-defined columns) Specifies the data type of the column. You can specify or change the field type of new site-defined columns by selecting a value from the drop-down. The following list describes the available Field Types:

    INTEGER

    Indicates a numeric value.

    STRING

    Indicates a text string. The String Length field indicates the number of characters in a string.

    DATE

    Indicates a date and time. The integer value stored in the database contains the number of seconds since midnight on January 1, 1970.

    DURATION

    Indicates a period of time. The value stored in the database is an integer containing a number of seconds.

    DOUBLE

    Indicates a real (floating point) number.

    SREL

    Indicates a foreign key reference to another table. The SREL Table field specifies the referenced table. The value stored in the database is the rel attr of the referenced table, which can be either an integer or a string. The value displayed in the product is the common name of the referenced table row. For information on setting SREL attributes with foreign key values, see the Technical Reference Guide.

    BREL

    Indicates a virtual column representing the set of all objects with an SREL to this table. It exists only in the Object Engine and is not physically stored in the database. Select this field type only on direction from a CA Technologies employee.

    QREL

    Indicates a virtual column representing a set of objects selected by the where clause on the Advanced tab. It exists only in the Object Engine and is not physically stored in the database. Select this field type only on direction from a CA Technologies employee.

    DERIVED

    Indicates a virtual column constructed by the Object Engine from the values of other columns, under the direction of a formula specified on the Advanced tab. It exists only in the Object Engine and is not physically stored in the database. Select this field type only on direction from a CA Technologies employee.

    String Length

    The length of a string column. This field is blank for non-string columns. It is read-only for all standard columns, and for site-defined columns that have been saved. You can specify or change the length of new site-defined STRING columns by entering an integer between 1 and 32767 in this field.

    SRel Table

    The table referenced by an SREL column. This field is blank for non-SREL columns. It is read-only for all standard columns, and for site-defined columns that have been saved. You can specify the table referenced by a new site-defined SREL by selecting it from the drop-down list.

    On New Default

    The default value assigned to this column when a new row of the table is defined. It should be a value appropriate to the field type. Some keyword values are available for particular field types:

    NOW

    Specifies the current date and time for a DATE column.

    USER

    Specifies the active user for an SREL to the Contact table.

    On Save Set

    The value assigned to this column when a row of the table is updated. It should be a value appropriate to the field type. Some keyword values are available for particular field types:

    NOW

    Specifies the current date and time for a DATE column.

    USER

    Specifies the active user for an SREL to the Contact table.

    Required

    When checked, this option indicates that a value must be supplied for the column before a row of the table containing it can be saved. You can set this option for both standard and site-defined columns, and you can disable an option that you have set. However, you cannot turn off the option of a standard column unless it was set by your site.

    Updatable only for new record

    When checked, this option indicates that a value for this column can be provided only when a row of its table is initially created, and cannot thereafter be changed. You can set this option for both standard and site-defined columns, and you can disable an option that you have set. However, you cannot turn off the option of a standard column unless it was set by your site.

    Key for pdm_userload

    When checked, this option indicates that this column is one of the columns tested by pdm_userload to determine whether or not its input is an update to an existing row. This option is available only for STRING columns. It is read only for all columns in standard tables.

    DBMS Index Options

    These options specify characteristics of a column that is an index of the physical DBMS. They are available only for columns in site-defined tables.

    Unique

    Specifies that the column is unique within the table and that no two rows have the same value for the column.

    Ascending

    Specifies that the DBMS index is listed in ascending sequence by this column. Mutually exclusive with Descending.

    Descending

    Specifies that the DBMS index is listed in descending sequence by this column. Mutually exclusive with Ascending.

    Important! The Schema Designer includes an Advanced tab. Information on this tab is intended for CA Technologies Support and field representatives. You will not need to work with this tab for most uses of the Schema Designer, and it will not be discussed further in this document.

  5. Do one of the following to save the column:

    The column is added to the table.