Create a Primary Key Constraint

You can create a primary key constraint on a table that does not have a primary key defined. Follow these steps:

  1. Click the + to the left of the Tables node to view the list of tables. Then right-click the name of the table to create a primary key constraint.

  2. Select Constraint, then select Add Primary Key.

    The Add primary key dialog appears.

  3. In the key index type field choose either Use range to create a primary key using a range index or Use hash to create a primary key using a hash index.

    If you choose Use hash, you see the text with number of followed by a drop-down list of either row or pages. Select either row or pages and in the box after the colon (:), enter the number of rows or pages. The default selection is row.

    For more information on hash index sizing, see "Column Definition" in the Oracle TimesTen In-Memory Database SQL Reference.

  4. In the Constraint Name field, enter the constraint name. The name cannot exceed 30 characters in length.

  5. In the Column field(s), you see a drop-down list of column names. Choose the column name(s) to use for the primary key.

  6. Click Apply.

    The Confirm dialog box appears indicating that the primary key constraint has been added.

  7. Click OK.

    The primary key constraint has been added successfully.

To view the SQL statement used to create the primary key constraint, choose the SQL tab of the Add primary key dialog box.

For information about creating a primary key constraint, see "CREATE TABLE" in the Oracle TimesTen In-Memory Database SQL Reference or "ALTER TABLE" in the Oracle TimesTen In-Memory Database SQL Reference.

Related Topics

SQL Developer: TimesTen Tasks

SQL Developer Concepts and Usage