Previous Topic: Joining Tables or Database RecordsNext Topic: Joining Tables


Relating Tables and Records

Tables

In many cases, you want to retrieve information from two or more tables. For example, to retrieve the name of each department manager, you must get the manager's ID from the DEPT table and the name that corresponds to the ID from the EMP table. With CA OLQ, you can obtain information from two tables by joining the tables based on a column both tables have in common.

Database records

Additionally, if you are using CA IDMS/DB database records, you can join the records based on a common value or you can join the records by specifying a record-to-record set relationship. For example, to retrieve information about employees and where they work, you would use the OFFICE-EMPLOYEE set of the Employee Database.

Tables and records

In some cases, you will want to retrieve information that exists in a table and in a record; for example, a CA IDMS/DB record (DEPARTMENT) and a table (EMP).

This chapter explains how to retrieve data from each of these data structures.