Destroys the temporary data-load memory buffer(s) allocated by EssLoadBufferInit for loading data into an aggregate storage database. Optionally, the data can be committed first.
Applies only to aggregate storage databases.
Syntax
ESS_FUNC_M EssLoadBufferTerm (hCtx, AppName, DbName, ulBufferCnt, *ulBufferIdAry, ulCommitType, ulActionType, ulOptions);
Parameter | Data Type | Description | ||
---|---|---|---|---|
hCtx | ESS_HCTX_T | API context handle. | ||
AppName | ESS_STR_T | Name of the application. | ||
DbName | ESS_STR_T | Name of the database. | ||
ulBufferCnt | ESS_ULONG_T | Number of buffers in the list. | ||
*ulBufferIdAry | ESS_ULONG_T | Array of buffer IDs that will be affected by this operation. | ||
ulCommitType | ESS_ULONG_T | One of the following constants for combining the values stored in the buffer with the values already stored in the database:
When committing multiple buffers, the values from different buffers are always combined using the add operation, regardless of this ulCommitType setting or how the buffers themselves are configured.
| ||
ulActionType | ESS_ULONG_T | One of the following constants:
| ||
ulOptions | ESS_ULONG_T | One of the following constants:
|
Notes
This function destroys the specified set of load buffers (usually a single load buffer). If the specified action type is "commit," data currently stored in the buffer is applied to the database before the buffers are destroyed.
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