Product Documentation

c-treeDB API for C++ - Developers Guide

Previous Topic

Next Topic

CTSegment::GetPartialFieldName

Retrieves the name of a field that match a key segment, even when the segment does not match the entire field length.

Declaration

CTString CTSegment::GetPartialFieldName();

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 it is required by SQL. 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.

CTSegment::GetPartialFieldName() was added to retrieve the name of a field that match a key segment, even when the segment does not match the entire field length.

Return

GetPartialFieldName() returns a CTString object with the name of the field if a match can be found. If a match can’t be found, GetPartialFieldName() throws a CTException object.

Example


// Display the field name of a partial match

void PrintFieldMatch(CTIndex &hIndex, NINT segnbr)

{

printf("Field name: %s\n",

hIndex.GetSegment(segnbr).GetPartialFieldName().c_str());

}

See Also

CTSegment::GetField(), CTSegment::GetFieldName(), CTSegment::GetPartialField()

TOCIndex