Discovers if all member names are unique within a dimension at the generation or level specified.
Syntax
ESS_FUNC_M EssOtlIsMemberNameUniqueWithinDimAtGenLevel (hOutline, hDim, bGen, usGenLevel, *pbNameUnique);| Parameter | Data Type | Description |
|---|---|---|
hOutline | ESS_HOUTLINE_T | Outline context handle. |
hDim | ESS_HMEMBER_T | Input dimension, returned by EssOtlQueryGetFirstDimension() or EssOtlQueryGetNextDimension(). |
bGen | ESS_BOOL_T | Input. If TRUE, usGenLevel is considered a generation number. If FALSE, usGenLevel is considered a level number. |
usGenLevel | ESS_USHORT_T | Input generation or level number. |
*pbNameUnique | ESS_BOOL_T | Output. TRUE if the dimension queried contains duplicate member names at the generation or level specified; FALSE otherwise. |
Notes
This function is one of three functions that query for member name uniqueness or non uniqueness.
EssOtlIsMemberNameNonUnique discovers if a member name is duplicate within an outline.
EssOtlIsMemberNameUniqueWithinDim discovers if all member names are unique within a dimension.
EssOtlIsMemberNameUniqueWithinDimAtGenLevel discovers if all member names are unique within a dimension at the generation or level specified.
Before you call this function, call EssOtlOpenOutlineQuery() to open the outline in query mode.
Return Value
Returns 0 if successful; otherwise, returns an error.
Example
ESS_FUNC_M ESS_ISUniqMemberNameWithinDimatGenLev()
{
ESS_STS_T sts = 0;
ESS_HOUTLINE_T hOutline;
ESS_OBJDEF_T Object;
ESS_APPNAME_T szAppName;
ESS_DBNAME_T szDbName;
ESS_OBJNAME_T szFileName;
ESS_HMEMBER_T hDim,hNextDim;
ESS_BOOL_T pbNameUnique, bGen = ESS_TRUE;
ESS_USHORT_T usGenLevel = 3;
memset(&Object, '\0', sizeof(Object));
Object.hCtx = hCtx;
Object.ObjType = ESS_OBJTYPE_OUTLINE;
strcpy(szAppName, "Demo");
strcpy(szDbName, "Test");
strcpy(szFileName, "Test");
Object.AppName = szAppName;
Object.DbName = szDbName;
Object.FileName = szFileName;
sts = EssOtlOpenOutlineQuery (hCtx, &Object, &hOutline);
if (!sts)
{
sts = EssOtlQueryGetFirstDimension(hOutline, &hDim);
if (sts)
printf("EssOtlQueryGetFirstDimension failed sts %ld\n",sts);
}
if (!sts)
{
sts = EssOtlIsMemberNameUniqueWithinDimAtGenLevel (hOutline, hDim, bGen, usGenLevel, &pbNameUnique);
if (sts)
printf("EssOtlIsMemberNameUniqueWithinDimAtGenLevel failed sts %ld\n",sts);
else
printf("pbNameUnique is %d\n", pbNameUnique);
}
if (!sts)
{
sts = EssOtlQueryGetNextDimension (hOutline, hDim, &hNextDim);
if (sts)
printf("EssOtlQueryGetFirstDimension failed sts %ld\n",sts);
}
if (!sts)
{
sts = EssOtlIsMemberNameUniqueWithinDimAtGenLevel (hOutline, hNextDim, bGen, usGenLevel, &pbNameUnique);
if (sts)
printf("EssOtlIsMemberNameUniqueWithinDimAtGenLevel failed sts %ld\n",sts);
else
printf("pbNameUnique is %d\n", pbNameUnique);
}
return sts;
}See Also