Queries member information for a given attribute member or function, enabling specification of the perspective for varying attributes.
Syntax
ESS_FUNC_M EssOtlQueryVaryingAttributes (hOutline, pAttrQuery, pPerspective,
pCount, pphMembers);
Parameter | Data Type | Description |
---|---|---|
hOutline | ESS_HOUTLINE_T | Outline context handle. |
pAttrQuery | ESS_PATTRIBUTEQUERY_T | Pointer to the structure that defines the query.
|
pPerspective | ESS_PPERSPECTIVE_T | Pointer to a collection of independent members used when querying the client or server for associations. |
pCount | ESS_PMBRCOUNTS_T | Pointer to the number of base members returned. |
pphMembers | ESS_PPHMEMBER_T | Pointer to the array of attribute member handles. |
Notes
Similar to EssOtlQueryAttributesEx, this function performs an attribute query. When the query involves an input base member and output attribute members, or an input attribute member and output base members, the given perspective is used to restrict the results based on the associations that are valid in the perspective.
The structure ESS_VARYING_ATTRIBUTEQUERY_T is identical to ESS_ATTRIBUTEQUERY_T, except that the varying version contains a field for the attribute dimension.
Note that the perspective must specify discrete independent members individually.
If no perspective is specified, or if the perspective specifies a NULL set of independent members, the routine will consider all associations that exist for any combination of independent members. In this case, the returned validity sets may contain ranges for discrete independent members, and it is the responsibility of the client to split this accordingly.
Return Value
Returns 0 if successful.
Example
void TestEssOtlQueryVaryingAttributes() { ESS_STS_T sts = ESS_STS_NOERR; ESS_HOUTLINE_T hOutline = ESS_NULL; ESS_OBJDEF_T Object; ESS_USHORT_T i = 0; ESS_HMEMBER_T hBaseMbr = ESS_NULL; ESS_PMBRINFO_T pMbrInfo = ESS_NULL; ESS_VARYING_ATTRIBUTEQUERY_T pAttrQuery; ESS_MBRCOUNTS_T Counts; ESS_HMEMBER_T hIndepMbrHandlesArray[4]; ESS_PERSPECTIVE_T Perspective; ESS_PHMEMBER_T phMbrHandles; ESS_HMEMBER_T hAttrMbr; ESS_HMEMBER_T hAttrDim; ESS_PREDICATE_T Predicate; memset(&Object, '\0', sizeof(Object)); Object.hCtx = hCtx; Object.ObjType = ESS_OBJTYPE_OUTLINE; Object.AppName = szAppName; Object.DbName = szDbName; Object.FileName = szDbName; printf("\n"); sts = EssOtlOpenOutlineQuery(hCtx, &Object, &hOutline); printf("EssOtlOpenOutlineQuery sts: %ld\n",sts); memset(&Counts, '\0', sizeof(Counts)); Counts.ulStart = 0; Counts.ulMaxCount = 0; /* Get handles for independent members */ memset(&Predicate, '\0', sizeof(Predicate)); Predicate.ulQuery = ESS_SEARCH; Predicate.ulOptions = ESS_MEMBERSONLY; Predicate.pszDimension = ""; Predicate.pszString1 = "Jan"; Predicate.pszString2 = ""; sts = EssOtlQueryMembersByName(hOutline, ESS_NULL, &Predicate, &Counts, &phMbrHandles); hIndepMbrHandlesArray[0] = phMbrHandles[0]; hIndepMbrHandlesArray[2] = phMbrHandles[0]; Predicate.pszString1 = "FY03"; sts = EssOtlQueryMembersByName(hOutline, ESS_NULL, &Predicate, &Counts, &phMbrHandles); hIndepMbrHandlesArray[1] = phMbrHandles[0]; Predicate.pszString1 = "FY04"; sts = EssOtlQueryMembersByName(hOutline, ESS_NULL, &Predicate, &Counts, &phMbrHandles); hIndepMbrHandlesArray[3] = phMbrHandles[0]; /* Get handles for attribute member and dimension */ Predicate.pszString1 = "Type"; sts = EssOtlQueryMembersByName(hOutline, ESS_NULL, &Predicate, &Counts, &phMbrHandles); hAttrDim = phMbrHandles[0]; Predicate.pszString1 = "Contractor"; sts = EssOtlQueryMembersByName(hOutline, ESS_NULL, &Predicate, &Counts, &phMbrHandles); hAttrMbr = phMbrHandles[0]; memset(&Perspective, '\0', sizeof(ESS_PERSPECTIVE_T)); Perspective.usValiditySetType = ESS_VALIDITYSET_TYPE_MBRHDLS; Perspective.countOfIndepDims = 2; Perspective.countOfIndepRanges = 1; Perspective.pIndepMbrs = hIndepMbrHandlesArray; /* Query by handle with InputMemberType of ESS_ATTRIBUTE_MEMBER and OutputMemberType of ESS_BASE_MEMBER*/ printf("\n*** Query by handle with InputMemberType of ESS_ATTRIBUTE_MEMBER and OutputMemberType of ESS_BASE_MEMBER:\n"); memset(&pAttrQuery, '\0', sizeof(ESS_ATTRIBUTEQUERY_T)); pAttrQuery.bInputMemberIsHandle = ESS_TRUE; pAttrQuery.uInputMember.hMember = hAttrMbr; pAttrQuery.uAttributeDimension.hMember = hAttrDim; pAttrQuery.usInputMemberType = ESS_ATTRIBUTE_MEMBER; pAttrQuery.usOutputMemberType = ESS_BASE_MEMBER; pAttrQuery.Attribute.usDataType = ESS_ATTRMBRDT_NONE; pAttrQuery.usOperation = ESS_ALL; sts = EssOtlQueryVaryingAttributes(hOutline, &pAttrQuery, &Perspective, &Counts, &phMbrHandles); printf("EssOtlQueryVaryingAttributes sts: %d\n", sts); if (!sts) { if(phMbrHandles) { GetMemberInfo(hOutline, Counts, phMbrHandles); if(Counts.ulReturnCount && phMbrHandles) sts = EssOtlFreeMembers(hOutline, Counts.ulReturnCount, phMbrHandles); } else printf("\tNo member returned.\n"); } sts = EssUnlockObject(hCtx, ESS_OBJTYPE_OUTLINE, Object.AppName, Object.DbName, Object.FileName); printf("\nEssUnlockObject sts: %d\n", sts); sts = EssOtlCloseOutline(hOutline); printf("EssOtlCloseOutline sts: %d\n",sts); }
See Also