# EssOtlQueryAttributes

Description

This function queries member information for a given attribute member or dimension.

Syntax

ESS_FUNC_M EssOtlQueryAttributes (hOutline, pAttributeQuery, pCount, pphMemberArray);

ESS_HOUTLINE_T | hOutline;
ESS_PATTRIBUTEQUERY_T | pAttributeQuery;
ESS_PULONG_T | pCount;
ESS_PPHMEMBER_T | pphMemberArrary;

Parameters

hOutline | Handle to the outline
pAttributeQuery | Structure that defines the query
pCount | Number of member handles returned
pphMemberArray | Pointer to an array of member handles returned

Return Value

Notes

- Before you call this function, call EssOpenOutlineQuery() to open the outline in query mode.

Access

Example

    void ESS_OtlQueryAttributes()
    {
       ESS_STS_T             sts = ESS_STS_NOERR;
       ESS_HMEMBER_T         hMember;
       ESS_OBJDEF_T          Object;
       ESS_APPNAME_T         szAppName;
       ESS_DBNAME_T          szDbName;
       ESS_OBJNAME_T         szFileName;
       ESS_SHORT_T           hOutlineQuery;
       ESS_ATTRIBUTEQUERY_T  pAttributeQuery;
       ESS_ULONG_T           Count = 0;
       ESS_PHMEMBER_T        phMemberArray = ESS_NULL;
       ESS_PMBRINFO_T        pMbrInfo = ESS_NULL;
       int                   index;

       memset(&pAttributeQuery, 0x00, sizeof(ESS_ATTRIBUTEQUERY_T));
       memset(&Object, '\0', sizeof(Object));
       Object.hCtx = hCtx;
       Object.ObjType = ESS_OBJTYPE_OUTLINE;
       strcpy(szAppName, "Sample");
       strcpy(szDbName, "Basic");
       strcpy(szFileName, "Basic");
       Object.AppName = szAppName;
       Object.DbName = szDbName;
       Object.FileName = szFileName;

       sts = EssOtlOpenOutlineQuery(hCtx, &Object, &hOutlineQuery);
       printf("EssOtlOpenOutlineQuery() sts: %ld\n",sts);
       pAttributeQuery.bInputMemberIsHandle == ESS_FALSE;
       pAttributeQuery.uInputMember.szMember = "100-10";
       pAttributeQuery.usInputMemberType = ESS_BASE_MEMBER;
       pAttributeQuery.usOutputMemberType = ESS_ATTRIBUTE_MEMBER;
       pAttributeQuery.usOperation = ESS_ALL;
       pAttributeQuery.Attribute.usDataType = ESS_ATTRMBRDT_NONE;

       sts = EssOtlQueryAttributes(hOutlineQuery, &pAttributeQuery, &Count, &phMemberArray);
       printf("EssOtlQueryAttributes() sts: %ld\n",sts);

       if (!sts && phMemberArray)
       {
          printf("\n------- Query Results -------\n");
          for (index = 0; index < Count; index++)
          {
             sts = EssOtlGetMemberInfo(hOutlineQuery,phMemberArray[index],&pMbrInfo);
             printf("\t%s\n",pMbrInfo->szMember);
          }

          if (Count && phMemberArray)
          {
             sts = EssOtlFreeMembers(hOutlineQuery,Count, phMemberArray);
          }
       }
    }

See Also

EssCheckAttributes()
EssFreeStructure()
EssGetAssociatedAttributesInfo()
EssGetAttributeInfo()
EssGetAttributeSpecifications()
EssOtlAssociateAttributeDimension()
EssOtlAssociateAttributeMember()
EssOtlDisassociateAttributeDimension()
EssOtlDisassociateAttributeMember()
EssOtlFindAttributeMembers()
EssOtlFreeStructure()
EssOtlGetAssociatedAttributes()
EssOtlGetAttributeInfo()
EssOtlGetAttributeSpecifications()
EssOtlSetAttributeSpecifications()