ctdbGetSegmentPartialField
Retrieves the field handle on which a key segment is based, even if the segment does not match the entire field length.
DECLARATION
CTHANDLE ctdbDECL ctdbGetSegmentPartialField(CTHANDLE Handle);
DESCRIPTION
FairCom DB API was able to find the matching between a key segment and a field only if the key segment started at the beginning of a field and exactly matched the field length, as it is required by FairCom DB SQL. It was desirable to retrieve a field on which the key segment start at the beginning of a field but does not exactly match the entire field.
CtdbGetSegmentPartialField() was added to FairCom DB API C API to retrieve the field handle on which a key segment is based, even if the segment does not match the entire field length.
ctdbGetSegmentPartialField() returns the handle of the field that matches the key segment definition. If a match can’t be found, or if an error is detected, this function returns NULL.
RETURN
Returns the field handle that matches the segment or NULL if no such match exists.
EXAMPLE
/* try to find a match, or partial match, for the key segment */
CTHANDLE GetFieldMatch(CTHANDLE hIndex, NINT segnbr)
{
CTHANDLE hField = NULL;
CTHANDLE hSegment = ctdbGetSegment(hIndex, segnbr);
if (hSegment)
hField = ctdbGetSegmentPartialField(hSegment);
return hField;
}
SEE ALSO
ctdbGetSegmentField(), ctdbGetSegmentFieldName()