Examining Tables and Table Objects

You can look at definitions for tables and table objects such as indexes, keys, and check constraints.

Examining Tables

To view the tables in a database:

  1. To view system tables as well as user tables, choose System Tables from the View menu. By default, only user tables are visible.
  2. Click the + symbol next to the Database icon in the left panel to show the Tables icon.
  3. Display the tables by doing one of the following:

Examining Columns

To view the columns in a table:

  1. Choose the table in either the left or the right panel (see Examining Tables and Table Objects for information on how to display tables in either panel).
  2. Choose the Table tab on the right panel.

Information about the table's columns appears in a grid on the bottom of the right panel. The name of each column is listed under Name in the grid. The grid is read-only.

The grid contains the following fields for each column in the table:

  1. Name

    The name of the column.

  2. Type

    The data type of the column.

  3. Nullable

    Shows whether the column can contain null values.

  4. Length

    The length of the column in bytes. Used only for CHAR, VARCHAR, BIT, and BIT VARYING columns.

  5. Precision

    The number of significant digits. Used only for DECIMAL and NUMERIC columns.

  6. Scale

    The number of digits after the decimal point. Used only for DECIMAL and NUMERIC columns.

  7. Default

    Any specified default value for this column.

  8. Auto Increment

    Whether an autoincrement default has been applied to this column. Only applicable for int type columns.

  9. Initial Value

    Optional starting value for autoincrement.

  10. Increment

    Optional value by which to increment an autoincrement field.

  11. Class

    The Java class used as the column's data type. Blank unless the value of the Type field is <JAVA OBJECT>.

Examining Indexes

To view the indexes defined on a table:

  1. Click the + to the left of the table name in the left panel.
  2. Click the Indexes icon.

A list of the table's indexes appears in the right panel.

For a more detailed view of indexes, do one of the following:

The right panel then displays three tabs:

Examining Keys

In addition to indexes, you can view and define primary, unique, and foreign keys on a table.

To view the keys defined on a table:

  1. Click the + to the left of the table name in the left panel.
  2. Click the Keys icon.

A list of the table's keys appears in the right panel. Key icons display with a letter indicating the key type: P for primary keys, U for unique keys, and F for foreign keys.

For a more detailed view of a key, do one of the following:

The right panel then displays two tabs:

Examining Check Constraints

To see the check constraints defined on a table:

  1. Click the + to the left of the table name in the left panel.
  2. Click the Checks icon.

A list of the table's check constraints appears in the right panel.

For a more detailed view of check constraints, do one of the following:

The right panel then displays two tabs:

Examining a Table's Properties

When a table is selected in the left panel, the table's Properties tab displays the following information:

You can modify the lock level for a table by clicking on the drop-down arrow.

Examining the Statement That Created a Table

To view the statement that created a table:

  1. Choose the table in the left panel.
  2. Choose the SQL tab.

The statement that created the table appears in the right panel. Below it is the statement that can delete the table, as well as statements to create and delete any indexes, keys, and check constraints on the table. These statements are read-only; you cannot modify or run them from this window. However, you can copy them into the SQL field on the Database panel, where you can save, edit, and execute them (see Executing Statements from the SQL Window).