Release 10.1A: OpenEdge Development:
Programming Interfaces

> ## Sample record fetches

> The following examples show some of the many ways you can access records. These examples are not meant to be exhaustive, but merely to show some of the flexibility provided by Progress.

> - Specify the `FIRST`, `LAST`, `NEXT`, or `PREV` options to step through all records in a particular sequence:

>     FIND FIRST Customer.

> - Specify boolean expressions to describe the record or records to be fetched:

>     FOR EACH Customer WHERE Credit-Limit > 5000 AND Balance < 12000:

> - Specify a constant value of the primary index for the record. This works only if the primary index is single-component. Also, this technique is not supported for the `OPEN` `QUERY` statement:

>     FIND Item 12.

> - Specify one or more field values that are currently in the screen buffer or record buffer:

>     PROMPT-FOR Customer.Cust-num WITH FRAME abc.
>     FIND Customer USING FRAME abc Customer.Cust-num.
>     DISPLAY Customer.Name.

> - Specify a previously found related record from another table (the two tables must share a field with the same name, and that field must have a `UNIQUE` index in at least one of the tables):

>     FIND FIRST Customer.
>     FOR EACH Order OF Customer: /* This uses the cust-num field */

> - Specify a `CONTAINS` clause on a word-indexed field:

>     FOR EACH Customer WHERE Comments CONTAINS "ship":

> You cannot use a `CONTAINS` clause with the `FIND` statement. You can use `CONTAINS` only with the `OPEN` `QUERY` and `FOR` `EACH` statements.

Copyright © 2005 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095