Changes the contents (pMemberArray) of an existing query hint; applies only to Release 9.3 or higher aggregate storage databases.
Syntax
ESS_FUNC_M EssOtlSetQueryHint (hOutline, hintNum, numMembers, pMemberArray);
Parameter | Data Type | Description |
---|---|---|
hOutline | ESS_HOUTLINE_T | Outline context handle (input). |
hintNum | ESS_SHORT_T | Query hint number (input). |
numMembers | ESS_SHORT_T | Number of members in the array provided - usually the number of real dimensions in the outline (input???) |
pMemberArray | ESS_PHMEMBER_T | An array of members for the hint. Usually the array has one member per real dimension, with NULL used for dimensions that are not part of the hint. This array needs to be allocated. (Input) |
Notes
Level usage constraints override query hints whenever a conflict occurs (see SetAggLevelUsage).
Hints may not contain dynamic, label-only, or shared members.
Hints may become invalid when the outline changes. Invalid hints result in a warning message.
Hints enable you to influence normal view selection by informing Essbase about the profile of common queries.
Hints are written as MDX tuples, with no more than one member from each dimension specified.
Each member used in the query hint is considered a representative member. Essbase Server interprets representative members as "this member or any member at the similar level of aggregation." For example, using a query hint of (Qtr1, Sales, 100, East, Actual) on Sample Basic means that quarterly, actual profit margin measures for level 1 products at level 1 markets is a common type of query.
For any given dimension, Essbase interprets the omission of representative members to mean that any member from the dimension may be used in a query. For example, using a query hint of (Sales, 100, East) on Sample Basic means that profit margin measures for level 1 products at level 1 markets is a common type of query, regardless of Year and Scenario dimensions, which were omitted. The hint (Sales, 100, East) is treated as identical to (NULL, Sales, 100, East, NULL).
Return Value
Returns 0 if successful.
Example
ESS_STS_T sts = ESS_STS_NOERR; ESS_HOUTLINE_T hOutline = ESS_NULL; ESS_SHORT_T nmHints = 0; ESS_SHORT_T i, j, hintNum; ESS_HMEMBER_T hMember[10]; /* (nm real dimensions) < 10 */ /* clear array just to be safe */ memset(hMember, 0x00, 10*sizeof(ESS_HMEMBER_T)); /* Code to assign hOutline variable omitted */ /* Code to assign hintNum variable omitted */ sts = EssOtlGetNumQueryHints(hOutline, &nmHints); if (sts) return sts; /* error out */ if (hintNum <= nmHints) { sts = EssOtlGetQueryHint(hOutline, hintNum, 10, hMember); if (sts) return sts; /* error out */ for (j = 0; j < 10; j++) { /* Code to inspect and change hMember[j] omitted */ } sts = EssOtlSetQueryHint(hOutline, hintNum, 10, hMember); if (sts) return sts; /* error out */ printf("Query-Hint number: (%d) updated\n", hintNum); } else { printf("Query-Hint number: (%d) does not exist\n", hintNum); }
See Also