Consultor Eletrônico



Kbase P177536: Does a FIND by RECID behave the same as a FIND by ROWID within a PRESELECT block?
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   11/17/2010
Status: Unverified

GOAL:

Does a FIND by RECID behave the same as a FIND by ROWID within a PRESELECT block?

GOAL:

If, within a PRESELECT block, you find a record using the RECID of that record, does Progress disregard any other selection criteria you applied to the PRESELECT?

FACT(s) (Environment):

All Supported Operating Systems
Progress 9.x
OpenEdge 10.x

FIX:

The behavior of ROWID and RECID are identical in this regard. If, within a PRESELECT block, you find a record using the ROWID or RECID of that record, Progress disregards any other selection criteria you applied to the PRESELECT.
For example, suppose the RECID of order number 4 is stored in the variable ord-recid. In this example, Progress finds and displays order number 4 even though the selection criteria specifies that the order number must be greater than 5.

DEFINE VARIABLE ord-recid AS RECID NO-UNDO.
FIND FIRST order WHERE order-num = 4.
ord-recid = RECID(order).
DO PRESELECT EACH order WHERE order-num > 5:
FIND FIRST order WHERE RECID(order) = ord-recid.
DISPLAY order.
END.
The ROWID or RECID always overrides other selection criteria. Furthermore, if you use FIND...WHERE ROWID(record) =... or FIND...WHERE RECID(record) =..., the index cursor is not reset in the preselected list. That is, even if record ROWID(record) or RECID(record) is in the preselected list, FIND NEXT does not find the record that follows it in the preselected list.