To create new relationships

Restriction: This topic applies to Windows environments only.

To create relationships on columns in a table in the current location:

  1. From the main menu, click Run > Tools > Data Tools > SQL Option for DB2 > Client > SQL Wizard.
  2. If the Catalog Browser window is not open, click * to open it.
  3. On the Catalog Browser window, ensure the Table tab is selected.
  4. Click the table you want.
  5. Click Alter.
  6. In the Relationships group, click Create.
  7. Type a name for the foreign key.
  8. Type the name of the parent (referenced) table for the foreign key or click Browse to search for it.
  9. Select the behaviour you require in the On Delete and On Update groups.
  10. Use the arrow pushbuttons to create a list mapping columns that you want to be foreign keys to the corresponding primary key columns in the parent table.
  11. When you have finished, click OK to close the Create Relationship dialog box.

    You can look at the SQL statements that will be used to make your changes by clicking SQL.

  12. Click OK to close the Alter Table window.