LookUp Group

Syntax

LOOKUP GROUP class_name { FROM | BACK } 
expression [ UNTIL expression ] [ SERIAL ] [ SECURE | KEYONLY ] 
[ MULTI expression ] [ GS status ]

Parameters

LookUp Group can be abbreviated as LU Group.

Description

The LookUp Group logic command reads persistent class records into memory from the database.

Upon natural termination of the LookUp Group logic command loop, the record remaining in memory is not defined. This record differs according to the host on which the application is running.

Upon explicit termination of the LookUp Group logic command loop, such as using a Break or JumpTo logic command, the record remaining in memory is the current record.

Refer to LookUp Variants for more information on the LookUp logic command.

Restrictions

The following restrictions apply to use of the LookUp Group logic command:

Example

This example illustrates code from a report that make use of the Lookup Group command (with the Back clause) to read records from the product table in descending order, starting from the specified Product ID.  The ProductID and ProductName are moved from each retrieved record into a ProductDetail frame and printed.

Message Attention “Please enter the starting product id”
Accept Start_id
Lookup Group Product Back (Start_id)
    ProductDetail.ProductID    := Product.ProductID  
    ProductDetail.ProductName := Product.ProductName
    ProductDetail.Print()
End
If (GLB.STATUS = "*****")
  Message Attention "No Product records found from starting ID"
End

For this example, if the input is provided as Start_id = “3”, then the output is as follows. The output displays the product details of the products in descending order, starting from the specified value which is “3”. If there had been no product whose Product ID was “3”, Lookup Group with the Back clause would have looked in reverse order for the next record to retrieve.

Product ID

Product Name

3

Gimborn R-7

2

Chips for cats

1

Outfit for Dogs