Edit-DB Edit-DB
(c) Nigel Maddocks, 2007
Edit-DB ver 2.05.016, Doc ver 2.05.016

3.4. Foreign key look-ups

In-line Display of Summary Data from Record Referenced by Foreign Key

When a table contains foreign keys, the database might also contain Views that pull together the base table columns plus information from the foreign key table. Where this is the case, you might choose to use to display the relevant View (see the Views section).

However there might not be existing Views, and you might not be authorised to create them, or you might prefer to work with the base table at the same time as being able to see information from the foreign key table.

Edit-DB is able to display data from the foreign key table simply by hovering over the foreign key column. The demonstration system contains a table called Employee which contains two foreign key columns, Role and Activity which refer to the primary keys of other tables. By hovering over the the Role column within a record, the Description from the foreign key table (also called Role) is displayed in a tool-tip pop-up.

Pop-up foreign key description

Just to emphasize, there is no setup required to enable this functionality, simply that there are foreign key relationships defined between tables.

Edit-DB will initially look for a column in the foreign key table called Description, ignoring case. Failing that, data is displayed from up to the first three columns containing character data, whose defined length is > 5.

Navigation to Record Referenced by Foreign Key

Alternatively, the record referenced by the foreign key can be viewed simply by double-clicking on the foreign key value, after ensuring that the double-click action is correctly set to FK rec here.

Setting the Double-Click Action to FK Record

The multi-record display will be re-positioned onto the referenced table, selecting the referenced record.