Working with Columns

Creating New Columns

When you create a column, you can choose where the new column is inserted in the table.

To add a column to a table:

  1. Click a table in the playpen. The location you click determines where the column will be inserted in the table.

    • If you click the table name or if the table does not contain any columns, the new column is added to the end of the column list.

    • If you click an existing column, the new column is added above the selected column.

  2. Click in the side toolbar. The Column Properties dialog box appears.

    Alternate methods:

    • Right-click a table, then click New Column.

    • Click a table, then press C.

  3. You can enter the following information:

    In this field ...

    Do this ...

    Name

    Enter the column name.

    Type

    Select the type of data the column holds.

    Precision

    Set the data precision.

    Scale

    Set the scale.

    In Primary Key

    Select the check box if the column is in the primary key.

    Allows Nulls

    Select the check box if the column handles null information.

    Auto Increment

    Select the check box if auto increment is allowed.

    Sequence Name

    When Power*Architect creates a table in a database platform that uses sequences (such as Oracle or PostgreSQL), Power*Architect creates a sequence for each auto-increment column in the table. Enter the name to use for the sequence.

    Note: This option is only available if you have selected the Auto Increment option for the column.

    Remarks

    Enter comments about the column. When you forward engineer the data model, the remarks will be included as comments in the database.

    Default Value

    Enter a default value for the column.

    Note: Power*Architect does not validate the default value, so ensure you use a valid format. The following examples show valid formats for different data types:

    • 'word' for a String

    • {d '2007-12-10'} for a Date

    • {t '5:38:00'} for a Time

    • {ts '2007-12-10 5:38:00'} for a Timestamp

  4. Click OK.

Modifying Columns

To modify a column:

  1. Click a column, then click in the side toolbar.

    Alternate methods:

    • Right-click a column, then click Column Properties.

    • Click a column, then press ENTER.

    The Column Properties dialog box appears.

    If you added this column to your data model using reverse engineering, the source database and table from which the column originated are shown at the top of the Column Properties dialog box.

  2. For modifying multiple columns at a same time: select multiple columns, then open column properties as above. The window looked like this:

    You can modify the properties of every column you selected by checking the checkboxes in front of them.

  3. Modify the column properties as required. For a description of the properties, see the section called “Creating New Columns” .

  4. Click OK.

Moving Columns

You can move a column from one table to another or rearrange columns within a table.

  • To move a column, click the column and drag it to a new location.

  • To move multiple columns, use CTRL+click to select the columns, then drag them to a new location.

Note: You can also add or remove columns from the primary key. For more information, see the section called “Working with Primary Keys” .

You can also use cut and paste to move to a column from one table to another. The column keeps the source for ETL mapping from the original table.

Copy Columns from external documents

To copy column from external documents (for example spreadsheets) into Power*Architect:

  1. Select & copy the columns from your external document

  2. Select the table in the Playpen you want to add the column to

  3. Press CTRL + V to copy the columns into the table