|
The Get Equal operation (B_GET_EQUAL) retrieves a record that has a key value equal to that specified in the Key Buffer. If the key allows duplicates, this operation retrieves the first record (chronologically) of a group with the same 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.
If the Get Equal operation is successful, the transactional interface returns the requested record in the Data Buffer and the length of the record in the Data Buffer Length parameter.
If the Get Equal operation is unsuccessful, the transactional interface returns one of the following status codes:
|
3
|
The file is not open.
|
|
4
|
The application cannot find the key value.
|
|
6
|
The key number parameter is invalid.
|
|
22
|
The data buffer parameter is too short.
|
This operation returns Status Code 4 if the key contains a non-zero value in a null indicator segment. You cannot use GetEqual to find records that are NULL, because by definition NULL is indeterminate, or not equal to anything. If you need to find NULL values, use GetFirst followed by GetNext.
The Get Equal operation establishes the complete logical and physical currencies and makes the retrieved record the current one.
|
Chapter contents
Prev topic: Get Directory (18)
|