To create a new relationship, you must select a parent
table, then select a child table.
Note: The
dialogs to select the parent and child tables are nearly identical.
In this example, the Select Relationship's Parent Table dialog
is used to illustrate the dialog.
- DB Aliases that correspond to the available databases
are listed on the left. Double-click a DB Alias name or overtype the
DB Alias in the Pattern box to display a list
of objects in the corresponding database. (If you change this selection
in either place, it changes in the other.)
- The list is in alphabetical order by Creator ID
and table name.
Pattern
Use
a Pattern to limit the list of database tables
in the Select Relationship's Parent Table dialog. After you specify
a pattern, click Refresh to redisplay the list
based on your criteria. See Use a Pattern for
more information.
After you select the parent table
and the child table for the relationship, the Relationship Editor
is populated with as much meaningful relationship information as possible.
If the parent table has a primary key, the column names
and data types of the primary key columns are inserted automatically
in the Parent Expression grid column. Processing then continues as
follows:
- If the data types are compatible, the name of a
column in the child table that matches the name of a primary key column
in the parent table is inserted in the Child Expression grid column.
- If no child table column names match, the child
table is checked for columns with the attributes of a primary key
column in the parent table. If a single child table column is found,
its column name is inserted in the Child Expression grid column. If
no columns or multiple columns are found, no column name is inserted.
If the parent table does not have a primary
key, a blank line is inserted. You can select column names from a
list or type the expressions directly.