EssOtlQueryMembers

Queries the outline.

Syntax

ESS_FUNC_M EssOtlQueryMembers (hOutline, hMember, pPredicate, pMbrCounts, phMemberArray);
ParameterData TypeDescription

hOutline

ESS_HOUTLINE_T

Essbase outline handle. This must have been returned from EssOtlOpenOutlineQuery.

hMember

ESS_HMEMBER_T

The handle of the member on which execute the operation. If this value is NULL, it is assumed to be the very top of the outline, representing the logical parent of the dimensions.

If the handle is a shared member, this function executes on the stored member on which it is based.

This value will be ignored for the following options:

  • ESS_NAMEDGENERATION

  • ESS_NAMEDLEVEL

  • ESS_USERATTRIBUTE

  • ESS_SEARCH

  • ESS_WILDSEARCH

pPredicate

ESS_PREDICATE_T

Structure defining the query. The fields of this structure are described in Notes.

pMbrCounts

ESS_MBRCOUNTS_T

Structure defining information about counts. It contains the following fields:

  • ulStart—Starting number to return

  • ulMaxCount—Maximum number of member handles to return

  • ulTotalCount—Total number of members that are defined in the results of the query

  • pulReturnCount—Number of member handles returned in this query

phMemberArray

ESS_PPHMEMBER_T

An array of member handles returned from the query.

Notes

Return Value

The return value is zero if the function was successful.

Example

#include <essapi.h>
#include <essotl.h>

ESS_STS_T          sts = ESS_STS_NOERR; 
ESS_HOUTLINE_T     hOutline; 
ESS_OBJDEF_T       Object;
ESS_HMEMBER_T      hMember = 0;
ESS_PREDICATE_T    Predicate;
ESS_MBRCOUNTS_T    Counts;   
ESS_PHMEMBER_T     phMemberArray = ESS_NULL;
ESS_ULONG_T        i;
ESS_ACCESS_T       Access;
ESS_STR_T          AppName;
ESS_STR_T          DbName;

AppName = "Sample";
DbName = "Basic";

sts = EssSetActive(hCtx, AppName, DbName, &Access);

if ( sts == 0)
{
   memset(&Object, '\0', sizeof(Object));    

   sts = EssOtlOpenOutlineQuery(hCtx, &Object, &hOutline); 

   memset(&Predicate, '\0', sizeof(Predicate));  
   Predicate.ulQuery           = ESS_CHILDREN;
   Predicate.pszDimension  = "Year";

   memset(&Counts, '\0', sizeof(Counts));  
   Counts.ulStart          = 0;
   Counts.ulMaxCount = 10;

   if(!sts)
   {
     sts = EssOtlQueryMembers(hOutline, hMember, 
           &Predicate, &Counts, &phMemberArray);

     if (!sts && Counts.ulReturnCount)
     {
        sts = EssOtlFreeMembers(hOutline, 
              Counts.ulReturnCount, phMemberArray);
     }
   }
}

See Also