Sybase 2 Barcode Reader User Manual


 
Working with keys
76 DataWindow .NET
In the following picture, the Department table has two keys:
A primary key (on
dept_id)
A foreign key (on
dept_head_id)
If you cannot see the lines
If the color of your window background makes it hard to see the lines for the
keys and indexes, you can set the colors for each component of the Database
painter's graphical table representation, including keys and indexes. For
information, see “Modifying database preferences” on page 58.
Opening related
tables
When working with tables containing keys, you can easily open related tables.
To open the table that a particular foreign key references:
1 Display the foreign key pop-up menu.
2 Select Open Referenced Table.
To open all tables referencing a particular primary key:
1 Display the primary key pop-up menu.
2 Select Open Dependent Table(s).
DataWindow Designer opens and expands all tables in the database
containing foreign keys that reference the selected primary key.
Defining primary keys
If your DBMS supports primary keys, you can define them in DataWindow
Designer.
To create a primary key:
1 Do one of the following:
Highlight the table for which you want to create a primary key and
click the Create Primary Key drop-down toolbar button in
PainterBar1.
Select Object>Insert>Primary Key from the main menu or
New>Primary Key from the pop-up menu.