Product Documentation

c-treeDB API for C++ - Developers Guide

Previous Topic

Next Topic

CTSegment::GetPartialField

Retrieves the field object on which a key segment is based, even when the segment does not match the entire field length.

Declaration

CTField CTSegment::GetPartialField() const;

Description

c-treeDB 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 is required by SQL standards. It was desirable to retrieve a field on which the key segment start at the beginning of a field and does not exactly match the entire field.

The CTSegment::GetPartialField() method retrieves a field object that match a key, even when the segment does not match the entire field length.

Return

GetPartialField() returns a field object if a match can be found. If a match can’t be found, GetPartialField() throws a CTException object.

Example


// find a field that match, or partial match, for the key segment

CTField GetFieldMatch(CTIndex &hIndex, NINT segnbr)

{

return hIndex.GetSegment(segnbr).GetPartialField();

}

See Also

CTSegment::GetField(), CTSegment::GetFieldName(), CTSegment::GetPartialFieldName()

TOCIndex