FIND PREV and FIND LAST statements
- Last Updated: January 17, 2024
- 1 minute read
- OpenEdge
- Version 12.8
- Documentation
FIND PREV and FIND LAST statements
Applications that use the FIND PREV or FIND LAST statements work on tables in a manner consistent with the OpenEdge
database. The only exception occurs when the FIND PREV or FIND LAST statement fails. In OpenEdge, the cursor is located after the last
record that was scanned. In the MS SQL Server data source, the cursor behaves as if the failed
FIND had never occurred. To support these statements, a table must include
support for the OpenEdge ROWID function (through either a
PROGRESS_RECID column or an indexed NUMBER column with
unique values). See ROWID function for more information.
For example, the procedure find.p accesses OpenEdge and
MS SQL Server databases using the same FIND and FIND PREV statements
in each case, as shown:
find.p
|
When you run find.p with an OpenEdge table and a MS SQL Server table, you get the following results (assuming that the database has records for customer numbers 1 through 4):

If the FIND PREV statement fails, the cursor remains located after
customer.custnum 3 in the OpenEdge table, which was the last record scanned. In the data
source table, the cursor is positioned at custnum 2. Failed finds do not affect cursor position in data source tables.