Tables are linked through their primary keys and foreign
keys. The primary key of one table is defined as the foreign key of
the other table.
Before you begin
Prerequisite: One of the tables must have a primary
key.
About this task
To link two tables:
- Start IBM® InfoSphere™ Data
Architect and
load the data model.
- Right-click the table where you want to create the link
and click .
- Select the table to link to.
- Type a name for the foreign key.
- In the Properties view, click the Details tab,
click the Browse button, select the column to which you want to assign
the foreign key, and click OK.
- In the Project Explorer view, right-click the table where
you added the foreign key and click Generate DDL.
- Make sure to select the following options: Fully qualified
names, CREATE statements, COMMENT ON statements, and IN TABLESPACE
clause.
- Click Next.
- Make sure to select the following options: Check constraint,
Foreign key constraint, Primary key constraint, and Tables.
- Click Next.
- Select Run DDL on server, click Next,
select the data warehouse connection, and click Next.
- When prompted, type the user name and password for the
database connection.
- Click Finish.