Creates a temporary data load buffer, which provides temporary storage for tuples during a data load into an aggregate storage database. Applies only to aggregate storage databases.
Syntax
ESS_FUNC_M EssLoadBufferInit (hCtx, AppName, DbName, ulBufferId, ulDuplicateAggregationMethod, ulOptionFlags, ulSize);
| Parameter | Data Type | Description | ||
|---|---|---|---|---|
hCtx | ESS_HCTX_T | API context handle. | ||
AppName | ESS_STR_T | Name of the application for which to create the load buffer. | ||
DbName | ESS_STR_T | Name of the database for which to create the load buffer. | ||
ulBufferId | ESS_ULONG_T | ID number for the data load buffer (a number between 1 and 999,999, inclusive). If the ID is already in use, the operation fails. | ||
ulDuplicateAggregationMethod | ESS_ULONG_T | One of the following constants for combining multiple values for the same cell within the buffer:
| ||
ulOptionFlags | ESS_ULONG_T | One or more of the following load buffer options:
Use bitwise OR (|) to specify multiple ulOptions; for example: ESS_ASO_DATA_LOAD_BUFFER_IGNORE_MISSING_VALUES | ESS_ASO_DATA_LOAD_BUFFER_IGNORE_ZERO_VALUES | ||
ulSize | ESS_ULONG_T | Percentage of total load buffer resources this load buffer may use. Possible values: 0 to 100. For a value of 0, Essbase uses a self-determined, default load buffer size. If the total size of all load buffers exceeds 100, the operation fails. |
Notes
Multiple buffers can exist on a single aggregate storage database; however, only one data load may use a given load buffer at a time.
Return Value
Returns zero if successful; otherwise, returns an error code.
Example
void TestBeginDataloadASO(ESS_HCTX_T hCtx, ESS_STR_T AppName, ESS_STR_T DbName)
{
ESS_STS_T sts = ESS_STS_NOERR;
ESS_BOOL_T Store;
ESS_BOOL_T Unlock;
ESS_BOOL_T abortOnError;
ESS_STR_T loadString;
ESS_OBJDEF_T rulesFile;
ESS_PMBRERR_T pMbrErr;
ESS_ULONG_T ulBufferId;
ESS_ULONG_T ulDuplicateAggregationMethod;
ESS_ULONG_T ulOptionsFlags;
ESS_ULONG_T ulSize;
ESS_ULONG_T ulBufferCnt;
ESS_ULONG_T ulCommitType ;
ESS_ULONG_T ulActionType;
ESS_ULONG_T ulOptions;
ESS_ULONG_T ulBufferIdAry[1];
/* EssLoadBufferInit */
ulDuplicateAggregationMethod = ESS_ASO_DATA_LOAD_BUFFER_DUPLICATES_ADD;
ulOptionsFlags = ESS_ASO_DATA_LOAD_BUFFER_IGNORE_MISSING_VALUES;
ulSize = 100;
ulBufferId = 201;
sts = EssLoadBufferInit(hCtx, AppName, DbName, ulBufferId, ulDuplicateAggregationMethod,
ulOptionsFlags, ulSize);
printf("EssLoadBufferInit sts: %ld\n", sts);
/* EssBeginDataloadASO, EssSendString, EssEndDataload */
Store = ESS_TRUE;
Unlock = ESS_FALSE;
abortOnError = ESS_FALSE;
loadString = "Mar Sale \"Curr Year\" \"Original Price\" \"017589\" \"13668\" Cash \"No Promotion\" \"1 to 13 Years\" \"Under 20,000\" \"Digital Cameras\" 111";
sts = EssBeginDataloadASO (hCtx, Store, Unlock, abortOnError, ESS_NULL, ulBufferId);
printf("EssBeginDataloadASO sts: %ld\n",sts);
sts = EssSendString(hCtx, loadString);
printf("EssSendString sts: %ld\n",sts);
sts = EssEndDataload(hCtx, &pMbrErr);
printf("EssEndDataload sts: %ld\n",sts);
/* EssLoadBufferTerm */
ulBufferCnt = 1;
ulBufferIdAry[0] = ulBufferId;
ulCommitType = ESS_ASO_DATA_LOAD_BUFFER_STORE_DATA;
ulActionType = ESS_ASO_DATA_LOAD_BUFFER_COMMIT;
printf("\Commit data to main slice and destroy buffer:\n");
ulOptions = ESS_ASO_DATA_LOAD_INCR_TO_MAIN_SLICE;
sts = EssLoadBufferTerm(hCtx, AppName, DbName, ulBufferCnt, ulBufferIdAry, ulCommitType,
ulActionType, ulOptions);
printf("EssLoadBufferTerm sts: %ld\n",sts);
}See Also