Get Previous (7)
The Get Previous operation (B_GET_PREVIOUS) retrieves the record in the logical previous position based on a specified key. You can use the Get Previous operation to retrieve a record within a group of records that have duplicate key values. You can use the Get Key (+50) bias to detect the presence of a value in a file. A Get Key operation is generally faster.
Parameters
 
Prerequisites
Procedure
1
For more information about locking, refer to the Pervasive PSQL Programmer's Guide.
2
3
4
5
Result
If the Get Previous operation is successful, the transactional interface updates the Key Buffer with the key value for the previous record, returns the previous record in the Data Buffer, and returns the length of the record in the Data Buffer Length parameter.
If the Get Previous operation is unsuccessful, the transactional interface returns one of the following status codes:
This operation returns Status Code 9 if the logical previous position points beyond the beginning of the file.
Positioning
The Get Previous operation establishes the complete logical and physical currencies and makes the retrieved record the current one.