RELATION( ) Function Example

In the following example, tables are opened and orders set, and then the relations are displayed using RELATION( ).

CLOSE DATABASES
OPEN DATABASE (HOME(2) + 'Data\testdata')
USE customer IN 0 ORDER cust_id  && Opens Customer table
USE employee IN 0 ORDER emp_id  && Opens Customer table
USE orders IN  0 ORDER order_id  && Opens Customer table
SELECT orders
SET RELATION TO emp_id INTO employee
SET RELATION TO cust_id INTO customer ADDITIVE
? RELATION(1)  && Displays CUST_ID
? RELATION(2)  && Displays EMP_ID
? RELATION(3)  && Displays empty string