image\Dql_0024.gifany

Type

Relational Operator

Purpose

The any operator selects the first record in a related table that matches the current record being processed. Since any returns the value from just the first related record, it is typically used when you are accessing the one side of a many-to-one relationship.

Syntax

any TABLENAME | RELATIONSHIP

 [named "UNIQUE RELATIONSHIP NAME" ]

 [with ( selection criteria) ] FIELDNAME ;|.

Returns:

The specified value from the first matching record in the related table. The type of value returned is the same as that of the specified field.

Usage:

The any operator can be used to:

Example

for FAMILY MEMBERS ;

list records

any MEMBERS LAST NAME in order ;

FIRST NAME;

DATE OF BIRTH.

end

 

This script tells DataEase: (1) Select all the FAMILY MEMBERS records, (2) for each record selected from the FAMILY MEMBERS table, list the LAST NAME from the (one) related MEMBERS record, and (3) list the first name and birthdate of each family member. The output, sorted by LAST NAME, might look as follows:

 

Last Name

First Name

Date of Birth

Adams

Will

09/23/60

Adams

Becca

04/28/90

Adams

Annalee

08/12/63

Albert

Roland

12/07/48

Albert

Rhonda

12/10/78

Albert

Lori

06/27/82

Albert

Kay.

11/03/50

...

...

...