Database Reference
In-Depth Information
•  IEssMember objects opened from an IEssCubeOutline are fully described objects
and all member properties are available, but you incur the overhead of opening
an IEssCubeOutline object. IEssMember objects obtained from other sources are
partially described and, therefore, not all member properties are available.
•  Working with shared members can be problematic and requires special care
to assure the IEssMember object returns the appropriate parent and sibling
information.
•  Cursoring is useful when working with large outlines, but it is only available
using a single executeQuery overload.
•  member set functions are useful for specifying members, but you must test the
functions to assure the member sets return the correct members.
next, let us discuss the second major methodology for getting member information,
the member query.
8.8 getting memBer inFormation using memBer Queries
The final method we will examine for getting member information, IEssCube.queryMem-
bers , is also the fastest method for getting member information. In fact, this method can
be up to 20 times faster than getting member information via an IEssMember object. here
are, however, some downsides to this approach. First, not all member properties can be
obtained using this method. Additionally, the member information is returned in a string
that must be parsed to get the individual properties and the documentation for this method
is poor. unless you are manipulating members in an Essbase outline, which requires work-
ing with an IEssMember object, this method is probably the best choice for most applica-
tions. In this section, we will see an example of the method call and will discuss how to
parse the information. We will also explore the available query options, but first let us look
at a very simple example. This is the simplest form of a query you can run with this method.
// query members from the cube
String results = cube.queryMembers("Colas");
What this query will return is a list of the member names that are tab-delimited (as
indicated by the escape sequence “\t” in the output):
100-10\t100-20\t100-30\t100
note that the query returns the children of Colas by default. What this means is
that you cannot return information about a single member with this method unless the
member is level-0 (or, in other words, has no children). The return value is in the form
of a single string, so you must parse the string using Java string manipulation methods.
For this example, you can easily parse the information using the Java split method:
// split the results on the tab character
String[] memberArray = results.split("\t");
// loop the array elements
for (String name : memberArray) {
// print the name
System.out.println("Name: " + name);
}
Search WWH ::




Custom Search