Defining foreign keys

These steps are part of the larger task of Defining a warehouse source table, Defining a warehouse source view, or Defining a warehouse target table. When you complete the steps for Defining foreign keys, return to Defining a warehouse source table, Defining a warehouse source view, or Defining a warehouse target table.

Use this window to define foreign keys for a warehouse source table, warehouse source view, or warehouse target table. The Data Warehouse Center uses foreign keys only in the join process. The Data Warehouse Center does not commit foreign keys that you define to the underlying database.

You can define the primary key to use in a star join with this target table as one of the source tables or for use by end users.

Before you begin, you must know the name and schema of the parent table to which the foreign keys correspond.

You can define foreign keys when the step is in development or test mode. If the step is in development mode, the key is created when you create the table by promoting the step to test mode. If the step is in test mode, the Data Warehouse Center alters the table to add the key when you click OK.

To define foreign keys:

  1. On the Foreign Keys page, right-click in the white space of the table and select Define. The Define Foreign Key window opens.

  2. Optional: In the Constraint name field, type a name for the foreign key constraint for the table.

    If you don't provide a name, the Data Warehouse Center generates a default name for the foreign key constraint.

  3. In the Object schema field, select the table schema for the parent table.

  4. In the Object name field, select the name of the parent table.

    The Primary key columns field shows the primary key columns that are associated with the table that you specified.

  5. From the Available columns list, select the column that you want to define as a foreign key, and click >. The column is moved to the Foreign key columns list.

    To include all of the columns in the Available columns list, click >>.

  6. Optional: To remove a foreign key definition from the table or view, select the column from the Foreign key columns list, and click <.

    To remove all of the columns from the foreign key definition, click <<.

  7. Click OK. The Define Foreign Key window closes and the foreign keys that you defined are displayed in the list of foreign keys on the Foreign Keys page.

Return to Defining a warehouse source table, Defining a warehouse source view, or Defining a warehouse target table.