Allows importing data from different sources to an Essbase aggregate storage database.
Syntax
ESS_FUNC_M EssImportASO (hCtx, pRules, pData, ppMbrErr, pUser, usabortOnError, ulBufferId);
| Parameter | Data Type | Description |
|---|---|---|
hCtx | ESS_HCTX_T | API context handle. |
pRules | ESS_OBJDEF_T | Pointer to the rules file object definition structure. |
pData | ESS_OBJDEF_T | Pointer to the data file object definition structure. |
ppMbrErr | ESS_MBRERR_T | Pointer to linked list of errors contained in ESS_MBRERR_T. Possible errors are:
|
pUser | ESS_MBRUSER_T | Pointer to the SQL user structure (if data source is a SQL database). A NULL SQL user structure indicates a non SQL data source. |
usabortOnError | ESS_USHORT_T | If TRUE, import stops on the first error. Oherwise, it continues. |
ulBufferId | ESS_ULONG_T | ID of a data load buffer (a number between 1 and 999,999). To destroy a buffer before a data load is complete, you must use the same ulBufferId number that was used to initialize the buffer. |
Notes
For a non SQL source, if the AppName and DbName fields in ESS_OBJDEF_T structures for pRules and pData are NULL, hCtx must be a local context handle, and the ESS_OBJDEF_T FileName field must contain the fully qualified path to the file.
If a local object is used, EssCreateLocalContext() must be called first.
The memory allocated for ppMbrErr must be freed using EssFreeMbrErr().
Return Value
Returns zero if successful; otherwise, returns an error code.
Access
This function requires the caller to have database designer privilege for the specified database (ESS_PRIV_DBDESIGN).
Example
void TestImportASO(ESS_HCTX_T hCtx, ESS_STR_T AppName, ESS_STR_T DbName)
{
ESS_STS_T sts = ESS_STS_NOERR;
ESS_SHORT_T isAbortOnError;
ESS_OBJDEF_T Rules;
ESS_OBJDEF_T Data;
ESS_PMBRERR_T pMbrErr = NULL;
ESS_PMBRUSER_T pMbrUser = NULL;
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];
ulDuplicateAggregationMethod = ESS_ASO_DATA_LOAD_BUFFER_DUPLICATES_ADD;
ulOptionsFlags = ESS_ASO_DATA_LOAD_BUFFER_IGNORE_MISSING_VALUES;
ulSize = 100;
ulBufferId = 10;
sts = EssLoadBufferInit(hCtx, AppName, DbName, ulBufferId, ulDuplicateAggregationMethod, ulOptionsFlags, ulSize);
printf("EssLoadBufferInit sts: %ld\n", sts);
/* Server object */
Rules.hCtx = hCtx;
Rules.AppName = AppName;
Rules.DbName = DbName;
Rules.ObjType = ESS_OBJTYPE_RULES;
Rules.FileName = "Dataload";
Data.hCtx = hCtx;
Data.AppName = AppName;
Data.DbName = DbName;
Data.ObjType = ESS_OBJTYPE_TEXT;
Data.FileName = "Dataload";
isAbortOnError = ESS_TRUE;
sts = EssImportASO (hCtx, &Rules, &Data, &pMbrErr, pMbrUser, isAbortOnError, ulBufferId);
printf("EssImportASO sts: %ld\n",sts);
if(pMbrErr)
EssFreeMbrErr(hCtx, pMbrErr);
/* Commit and delete the buffer */
ulBufferCnt = 1;
ulBufferIdAry[0] = ulBufferId;
ulCommitType = ESS_ASO_DATA_LOAD_BUFFER_STORE_DATA;
ulActionType = ESS_ASO_DATA_LOAD_BUFFER_COMMIT;
printf("\nCommit data to the main slice:\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