# EssOtlGetDimensionUserAttributes

Description

Returns the user defined attributes used in the specified dimension.

Syntax

    ESS_FUNC_M EssOtlGetDimensionUserAttributes (hOutline, pPredicate,
                                                 pCounts, ppAttributeNames);

ESS_HOUTLINE_T | hOutline
ESS_PPREDICATE_T | pPredicate
ESS_PMBRCOUNTS_T | pCounts
ESS_PPMBRNAME_T | ppAttributeNames

Parameters

hOutline | Essbase outline handle. This must have been returned from EssOtlOpenOutlineQuery().
pPredicate | Structure defining the query. The fields of this structure are used as follows: ulQuery Value defining the operation to perform. The only valid value is: ESS_DIMUSERATTRIBUTES pszDimension Dimension to limit the scope of the query. Specify a valid dimension name.
pCounts | Structure defining information about counts It contains the following fields: ulStart Starting number to return. ulMaxCount Maximum number of member names to return. ulTotalCount Total number of members that are defined in the results of the query. pulReturnCount Number of member names returned in this query.
ppAttributeNames | An array of attribute names returned from the query.

Return Value

The return value is zero if the function was successful.

Notes

- This function is used only to get the user's defined attributes on a specific dimension. Therefore, the only valid value for Predicate is ESS_DIMUSERATTRIBUTES_T.

Example

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

    ESS_STS_T          sts = ESS_STS_NOERR;
    ESS_HOUTLINE_T     hOutline;
    ESS_OBJDEF_T       Object;
    ESS_PREDICATE_T    Predicate;
    ESS_MBRCOUNTS_T    Counts;
    ESS_MBRNAME_T      pAttribNames;
    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_DIMUSERATTRIBUTES;
       Predicate.pszDimension  = "Market";

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

       if(!sts)
       {
         sts = EssOtlGetDimensionUserAttributes(hOutline,
                 &Predicate, &Counts, &pAttribNames);

         if (!sts && Counts.ulReturnCount)
         {
            sts = EssFree(hInstance, pAttribNames);
         }
       }
    }

See Also

EssFree()
EssOtlOpenOutlineQuery()
EssOtlQueryMembers()
EssOtlQueryMembersByName()