CTIndex::GetIndexFileName
Returns the name of the index file name for the given index name or number.
Declaration
CTString CTTable::GetIndexFileName(NINT IndexNumber)
CTString CTTable::GetIndexFileName(const CTString& IndexName)
Description
Retrieves the file pathname for the given index name or number. GetIndexFileName() accepts as parameters either the index number or the index name.
Return
The index file pathname is returned. If the index has no file name, for example, the index is a member of an index file, GetIndexFileName() returns an empty string.
Example
void SetFirstIndexName(CTTable& htable, const CTString idxFileName)
{
try
{
if (hTable.GetIndexFileName(0) != idxFileName)
{
hTable.SetIndexFileName(0, idxFileName);
hTable.Alter(CTDB_ALTER_NORMAL);
}
}
catch (CTException &err)
{
hSession.Abort();
printf("Error: %d - %s\n", err.GetErrorMsg(), err.GetErrorCode());
}
}
See Also
CTTable:GetIndexFilename(), CTTable::SetIndexFilename, CTIndex::SetIndexFilename