Returns the named sets in the query.
ESS_FUNC_M EssMdxGetNamedSets( ESS_HCTX_T hCtx, ESS_PULONG_T pulCount, ESS_PPSTR_T ppNames, ESS_PLONG_T *ppTypes);
Parameter | Type | Description |
---|---|---|
hCtx | input | Context handle. |
pulCount | output | Count of the named sets returned in the query. |
ppNames | output | An array of named sets. The memory allocated for ppNames should be freed using EssFree(). |
*ppTypes | output | Pointer to the named set type: ESS_MDX_NAMEDSET_TYPE_SESSION. |
The return values are the number of named sets in pulCount, the named sets in ppNames, and the type of the named sets in ppTypes.
This function requires no special privileges.
void TestGetNamedSets() { ESS_STS_T sts = ESS_STS_NOERR; ESS_STR_T fileNames[2]; ESS_CHAR_T qry[2][MAXQRYLEN]; FILE *fileHandle; char *s; int length, e, i; ESS_ULONG_T ulCount, j; ESS_PSTR_T pNames; ESS_PLONG_T pTypes; fileNames[0] = "D:\\testarea\\MDXAPI\\query3.txt"; fileNames[1] = "D:\\testarea\\MDXAPI\\query4.txt"; for(i = 0; i < 2; i++) { fileHandle = fopen(fileNames[i], "r"); if (!(fileHandle = fopen(fileNames[i], "r"))) { printf("\nUnable to open file: %s\n", fileNames[i]); return; } else { s = qry[i]; length = MAXQRYLEN; fgets(s, length, fileHandle); if ((e = ferror(fileHandle)) != 0) { printf("fgets error %d\n", e); exit((int) e); } fclose(fileHandle); } printf("\nThe query[%d]: \n%s\n", i, qry[i]); } ulCount = 0; sts = EssMdxGetNamedSets(hCtx, &ulCount, &pNames, &pTypes); printf("EssMdxGetNamedSets sts: %ld\n",sts); for(j = 0; j < ulCount; j++) { printf("\tpNames[%d]: %s\n", j, pNames[j]); printf("\tpTypes[%d]: %d\n", j, pTypes[j]); printf("\n"); } sts = EssFree(hInst, (ESS_PVOID_T)pNames); }