EssOtlQueryMembersByName

Queries the outline.

Syntax

ESS_FUNC_M EssOtlQueryMembersByName (hOutline, pszMember, pPredicate,
                                     pMbrCounts, phMemberArray);
ParameterData TypeDescription

hOutline

ESS_HOUTLINE_T

Outline context handle. This must have been returned from EssOtlOpenOutlineQuery().

pszMember

ESS_STR_T

The member name string of the member to do the operation on. If this value is NULL, it is assumed to be the very top of the outline, representing the logical parent of the dimensions. 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 member 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_STR_T          pszMember;
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;

pszMember = "Qtr1";
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 = EssOtlQueryMembersByName(hOutline, pszMember, 
           &Predicate, &Counts, &phMemberArray);

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

See Also