|
<< Click to Display Table of Contents >> DbiCompareKeys |
![]() ![]()
|
C syntax
DBIResult DBIFN DbiCompareKeys (hCursor, pKey1, [pKey2], iFields, iLen, piResult);
Delphi syntax
function DbiCompareKeys (hCursor: hDBICur; pKey1: Pointer; pKey2: Pointer; iFields: Word; iLen: Word; var iResult: SmallInt): DBIResult stdcall;
Description
DbiCompareKeys compares two key values based on the current index of the cursor.
Parameters
hCursor Type: hDBICur (Input)
Specifies the cursor handle.
pKey1 Type: pBYTE (Input)
Pointer to the first key value. The key is assumed to be in physical format.
pKey2 Type: pBYTE (Input)
Pointer to the second key value. Optional. If pKey2 is NULL, the key value is extracted from the current record. If the key is specified, it is assumed to be in physical format.
iFields Type: UINT16 (Input)
Specifies the number of fields to be used for composite keys. iFields and iLen together indicate how much of the key is to be used for matching. If both are 0, the entire key is used. If a match is required on a given field of the key, all the key fields preceding it in the composite key must also be supplied for a match. Only character fields can be matched for a partial key; all other field types must be fully matched.
For partial key matches, iFields must be equal to the number of key fields preceding (if any) the field being partially matched.
iLen Type: UINT16 (Input)
Specifies a partial length in the last field to be used for composite keys; works in conjunction with iFields. The last field of the composite key must be a character type if iLen not equal to 0.
piResult Type: pINT16 (Output)
Pointer to the client variable that receives the compared result.
Usage
This function is used to compare two key values. Keys can be obtained by using DbiExtractKey.
Prerequisites
There must be an active index.
DbiResult |
Meaning |
DBIERR_NONE |
The key fields were compared successfully. |
DBIERR_NOCURREC |
pKey2 is NULL and the current record is invalid. |
See also