Syntax
LOOKUP EVERY class_name [ SERIAL ] [ SECURE | KEYONLY ] [ MULTI expression ] [ GS status ]
Parameters
LookUp Every can be abbreviated as LU Every.
class_name
The persistent class to read. The specified class can also be a persistent external SQL class.
SERIAL
Increases efficiency by retaining pointers. Refer to Serial for more information.
SECURE
Facilitates record locking of the database in applications that do not force integrity. Refer to Secure for more information.
KEYONLY
The KeyOnly command option is not supported on applications that are deployed to Windows.
For MCP-based systems, refer to KeyOnly.
MULTI expression
The Multi command option is not supported on applications that are deployed to Windows or MCP.
GS status
Indicates if there are no records retrieved, using the specified qualifier.
Description
The LookUp Every logic command reads persistent class records into memory from the database. It sequentially reads every record in the requested class, each new record overwriting the previous.
Records are read in primary key order. For classes without keys, records are read in physical storage order. This physical storage order can change with record additions and deletions, or reorganization of the database. You can also use a persistent external SQL class to read records from an external database.
Refer to LookUp Variants for more information on the LookUp logic command.
Example
This example illustrates code from a report that reads records from the product table by using the Lookup Every command. Lookup Every retrieves records based on the key specified for the table (in this example, ProductID). The ProductID and ProductName are moved from each retrieved record into a ProductDetail frame and printed.
LookUp Every Product ProductDetail.ProductID := Product.ProductID ProductDetail.ProductName := Product.ProductName ProductDetail.Print() End If (GLB.STATUS = "*****") Message Attention "No Product records found" End
For this example, output from the report is as follows, in product ID order:
Product ID |
Product Name |
---|---|
1 |
Outfit for Dogs |
2 |
Chips for cats |
3 |
Gimborn R-7 |
4 |
KittenCaps |
5 |
Toys for Cats |
6 |
DogBelt |
7 |
CatBathSoap |
8 |
PetOutfit |
9 |
Leather Belt |
10 | ToyPet |