Kbase 21093: Index Cursors Explained
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  04/02/2005 |
|
Status: Verified
GOAL:
Index Cursors and how Progress uses them to retrieve records.
GOAL:
What is an Index Cursor?
GOAL:
How does Progress uses Index Cursors to retrieve records.
FACT(s) (Environment):
Progress 9.X
OpenEdge 10.x
FIX:
An "index cursor" is information that is used to maintain a position within an index.
It can be moved to the next (FIND NEXT, GET NEXT), the previous (FIND PREVIOUS; GET PREVIOUS), or a specific index entry, and it can be used to read the row at the current entry.
Index cursors are managed by the server on behalf of the clients.
A cursor is opened, closed, repositioned, and used to fetch rows for a specific client at the request of the client.
Multiple index cursors can be opened on one or more indexes at any time.
FIND FIRST customer.
REPEAT:
UPDATE customer.
FIND NEXT customer NO-ERROR.
IF NOT AVAILABLE customer THEN LEAVE.
END.
After you use the FIND LAST statement to find the last record in a table, Progress positions the index cursor on that record. Any references within the same record scope to the next record fail.
FIND LAST customer.
RELEASE customer.
DISPLAY AVAILABLE customer.
REPEAT:
FIND NEXT customer.
DISPLAY name.
END.
In this example, the RELEASE statement releases the last customer record from the customer record buffer and the following DISPLAY statement displays FALSE because the customer record is no longer available. However, the index cursor is still positioned on that last record. Therefore, the FIND NEXT statement fails.
References to Written Documentation:
Progress Solutions:
Solution 21091, "Index Management and Performance Considerations"
Solution 21092, "Row Identifiers, RECID and ROWID Explained"
Solution 21094, "Index Brackets Explained"
Solution 21095, "Row Retrieval Process Explained"
Solution 21096, "ROWID Record Retrieval Explained"
Solution 21097, "Using USE-INDEX Explained"
Solution 21098, "Single Index Selection Explained"
Solution 21099, "Multiple Index Selection Explained"
Solution 21100, "Using XREF Within Indexes Explained"