Step Last (34)
The Step Last operation (B_STEP_LAST) retrieves the last physical record of the file. The transactional interface does not use a key path to retrieve the record.
Parameters
Op Code
Pos Block
Data Buf
Data Buf Len
Key Buffer
Key Number
Sent
Returned
Prerequisites
The file must be open.
Procedure
1
Set the Operation Code to 34. Optionally, you can include a lock bias:
•
+100—Single wait record lock.
•
+200—Single no-wait record lock.
•
+300—Multiple wait record lock.
•
+400—Multiple no-wait record lock.
For more information about locking, refer to the
Pervasive PSQL Programmer's Guide
.
2
Pass the Position Block for the file.
3
Set the Data Buffer Length to a value greater than or equal to the length of the record to retrieve.
Result
If the Step Last operation is successful, the transactional interface returns the file’s last physical record in the Data Buffer and sets the Data Buffer Length parameter to the number of bytes returned.
If the Step Last operation is unsuccessful, the transactional interface may return one of the following status codes:
3
The file is not open.
9
The operation encountered the end-of-file. (when the file is empty)
22
The data buffer parameter is too short.
Positioning
The Step Last operation destroys logical currency. Step Last sets the physical currency using the retrieved record as the current physical record. The next physical position points beyond the end of the file.