EsbOtlQueryMembersByName

Queries the outline.

Syntax

EsbOtlQueryMembersByName (hOutline, pszMember, pPredicate, pCounts)
ByVal hOutline   As Long 
ByVal pszMember  As String
      pPredicate As ESB_PREDICATE_T
      pCounts    As ESB_MBRCOUNTS_T
ParameterDescription

hOutline

Essbase outline handle. This must have been returned from EsbOtlOpenOutlineQuery().

pszMember

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:

  • ESB_NAMEDGENERATION

  • ESB_NAMEDLEVEL

  • ESB_USERATTRIBUTE

  • ESB_SEARCH

  • ESB_WILDSEARCH

pPredicate

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

pCounts

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.

Notes

Return Value

The return value is zero if the function was successful.

Example

Declare Function EsbOtlQueryMembersByName Lib "ESBOTLN" 
(ByVal hOutline As Long, ByVal pszMember As String,
pPredicate As ESB_PREDICATE_T, pCounts As ESB_MBRCOUNTS_T) As Long
Declare Function EsbOtlFreeMember Lib "ESBOTLN" 
(ByVal hOutline As Long, ByVal hMember As Long) As Long

Sub ESB_OtlQueryMembersByName()
   Dim sts As Long
   Dim hOutline As Long
   Dim pszMember As String
   Dim ihMember As Long
   Dim Object As ESB_OBJDEF_T
   Dim MbrInfo As ESB_MBRINFO_T
   Dim Predicate As ESB_PREDICATE_T
   Dim Counts As ESB_MBRCOUNTS_T
   Dim Access As Integer
   Dim AppName As String
   Dim DbName As String
   
   pszMember =  "Qtr1"
   AppName = "Sample"
   DbName = "Basic"
   sts = EsbOtlOpenOutlineQuery(hCtx, Object, hOutline)   'open outline
   If sts = 0 Then                                        'proceed if open successful
                                                          'else message with error
      Predicate.ulQuery = ESB_CHILDREN
      Predicate.pszDimension = "Year"
      Counts.ulStart = 0
      Counts.ulMaxCount = 10
      If sts = 0 Then
         sts = EsbOtlQueryMembersByName(hOutline, pszMember, Predicate, Counts)
        If sts = 0 And Counts.ulReturnCount <> 0 Then
          For n% = 1 To Counts.ulReturnCount
             sts = EsbGetNextItem(hCtx, ESB_HMEMBER_TYPE, ihMember)
          If sts = 0 And ihMember <> 0 Then
                   sts = EsbOtlFreeMember(hOutline, ihMember)
          End If
          Next
        End If
      End If
   Else
     msgbox "Outline open failed with error: " & sts
   Endif
End Sub

See Also