ctdbIsRecordRangeOn
Indicate if an index range operation is active for this record handle.
Declaration
CTBOOL ctdbIsRecordRangeOn(CTHANDLE Handle);
Description
ctdbIsRecordRangeOn() returns YES if a index range operation is active for this record handle, or NO is no index range is active.
Return
Value |
Symbolic Constant |
Explanation |
---|---|---|
0 |
NO |
No index range operation is active |
1 |
YES |
Index range operation is active |
See c-treeDB API Errors and Return Values for a complete listing of valid c-treeDB API error codes and return values.
Example
/* display all records where age is greater than 65 */
void DisplayAll(CTHANDLE hRecord)
{
UTEXT lRange[32];
VRLEN lRangeLen = 32;
NINT op[1] = {CTIX_GT};
NINT fldno = ctdbGetFieldNumberByName(hHandle, "age");
CTDBRET eRet;
ctdbClearRecord(hRecord);
ctdbSetFieldAsSigned(hRecord, fldno, 65);
ctdbSetDefaultIndex(hRecord, 0);
ctdbBuildTargetKey(hRecord, CTFIND_EQ, lRange, &lRangeLen);
eRet = ctdbRecordRangeOn(hRecord, 1, lRange, NULL, op);
if (eRet == CTDBRET_OK)
{
eRet = ctdbFirstRecord(hRecord);
while (eRet == CTDBRET_OK)
{
TEXT str[128];
ctdbGetFieldAsString(hRecord, 0, str, sizeof(str));
printf("%s\n", str);
eRet = ctdbNextRecord(hRecord);
}
}
if (ctdbIsRecordRangeOn(hRecord))
ctdbRecordRangeOff(hRecord);
}
See also
ctdbRecordRangeOn(), ctdbRecordRangeOff()