Database Reference
In-Depth Information
he openMemberSelection method requires you to pass a name argument. The argu-
ment has no special requirements and is not required to be unique. When you use a
member selection object, however, it is a requirement that you subsequently call the
IEssMemberSelection.close method when you are done using it. If you fail to call the
close method, the result will be orphaned connections on your Essbase server. to pre-
vent orphaned connections, use a try/catch/finally block to close the selection if neces-
sary. you will need to declare the IEssMemberSelection object outside of your try/catch/
finally block in order for the variable to be in scope in the finally block.
IEssMemberSelection selection;
try {
// open the member selection
selection = cube.openMemberSelection("default");
// do some work here
} catch (EssException e) {
// process your exception here
} finally {
// if the member selection object has been created
if (selection != null) {
// close the member selection to prevent hanging connections
selection.close();
}
}
here is a query that returns the children of the Colas member. The first argu-
ment, “Colas,” is the base member to use for the query. The second argument,
IEssMemberSelection.QUERY_TYPE_CHILDREN , specifies that the query should
return members based on a relationship to the base member, which, in this case, is the
children. The third argument allows you to specify certain options, such as return-
ing only a count of the members and whether or not to return relational members
when accessing a hybrid analysis database; in our example, we will not specify any
options. This argument uses an integer type so you must pass a numeric zero to specify
no options. The fourth argument, “Product,” limits the search for the base member to
the Product dimension. The fifth and sixth arguments are used to specify additional
options for certain query types. The last two arguments are cursoring options and, in
this case, specify that the query should return members starting with the first member
in the query and return the first 1000 members. These options are extremely useful
if you have a large outline, as you can use them to reduce the number of members in
memory.
// execute the query
selection.executeQuery("Colas",
IEssMemberSelection.QUERY_TYPE_CHILDREN,
0,
"Product", null, null, 0, 1000);
once the query has been executed, you must grab the members to process. he
IEssMemberSelection.getMembers returns an IEssIterator that gives you access to each
member.
Search WWH ::




Custom Search