Chapter 3 Building Physical Diagrams
A join is a link between a column in a parent table and a column in a child table (column pair) that is defined within a reference.
A join can link primary key, or alternate key, and foreign key columns, or user specified columns in the parent and child tables that are independent of key columns.
When you create a reference, the current selections for Model Options determine the creation of the following types of default joins:
Join creation is determined by the following selections for Model Options:
Default Link on Creation | Auto-migrate Columns | Result |
---|---|---|
Primary Key | Selected | Joins created between primary and foreign key columns |
Not selected | Joins are created that are linked to primary key columns, but are incomplete. Foreign key columns must be specified manually | |
User-defined | Selected | No joins created. Parent and child table column pairs must be specified manually |
Not selected | No joins created. Parent and child table column pairs must be specified manually |
For any reference you can choose to link a primary key, or alternate key, to a corresponding foreign key. When you select a key from the Joins page of the reference property sheet, all the key columns are linked to matching foreign key columns in the child table.
Changing a foreign key column link
A foreign key column can also be changed to link to another parent table column, either within the key relationship, or independent of it.
You can use the following buttons on the Joins page to reuse or migrate columns linked by joins.
Button | Name | Description |
---|---|---|
Reuse Columns | Reuse existing child columns with same code as parent table columns | |
Migrate Columns | Migrate key columns to foreign key columns. If columns do not exist they are created | |
Cancel Migration | Delete any migrated columns in child table |
The join order can be established automatically or manually by using the Auto Arrange Join Order check box. The Auto Arrange Join Order check box is grayed if the reference is not joined to a key.
Selecting or clearing the Auto arrange join order check box has the following effects:
Auto Arrange Join Order | Effect |
---|---|
Checked | Sorts the list according to the key column order (the move buttons are not available) |
Cleared | Allows you to manually sort the join order with the move buttons (the move buttons are available) |
To define joins in a reference:
EnableChangeJoinOrder
item to the Reference category in the DBMS definition file and set the value to YES. For information on adding an item to the Reference category, see chapter DBMS Reference Guide in the Advanced User Documentation .
Copyright (C) 2005. Sybase Inc. All rights reserved. |