Dictionary L-Type Records

Top  Previous  Next

 

An L-type record represents a link to another file. It can be used in query processor commands to reference fields in a dependent file without the need to create an I-type TRANS() expression for each field.

 

1:L  { descriptive text }
2:Id expression
3:File name

 

The expression in field 2 is constructed in exactly the same was as an I-type expression and derives the record id of the record(s) in the linked file from data in the original file.

 

 

Example

 

If a library application has two files, BOOKS and TITLES where the record id of BOOKS is formed from the id of the corresponding TITLES record and the copy number separated by a hyphen, the following link placed in the dictionary of the BOOKS file could be used to access the associated TITLES record:

 

1:  L

2:  @ID['-', 1, 1]

3:  TITLES

 

Queries based on the BOOKS file could then reference data from the TITLES file using field names made up from the name of the link record, a % character and the name of the TITLES field to be accessed. For example, if the above line was named TTL, a query such as

LIST BOOKS TTL%TITLE TTL%AUTHOR

could be used to print a list of book titles and their authors.