# EssBeginDataload

Description

EssBeginDataload() starts sending an update specification to the active database, and can unlock any data blocks locked for update. The update data can either be stored in the database, or just verified and any errors returned.

Syntax

    ESS_STS_T EssBeginDataload (hCtx, Store, Unlock, abortOnError, pRules);

ESS_HCTX_T | hCtx;
ESS_BOOL_T | Store;
ESS_BOOL_T | Unlock;
ESS_BOOL_T | abortOnError;
ESS_POBJDEF_T | pRules;

Parameters

hCtx | Essbase API context handle.
Store | Controls storage of data. If TRUE, data is stored in the server; if FALSE, no data is stored.
Unlock | Controls unlocking of data blocks. If TRUE, all relevant blocks which are locked will be unlocked (after data is stored, if necessary). If FALSE, no blocks are unlocked.
abortOnError | If TRUE, data load stops on the first error. Otherwise, data load continues.
pRules | Pointer to the rules file object definition structure.

Return Value

None.

Notes

- EssBeginDataload() must be followed by at least one call to EssSendString() to send the update specification, and then a call to EssEndDataload().
- Each string passed to EssSendString() following EssBeginDataload() must be terminated with a carriage return/linefeed character sequence ("\r\n").
- If both the Store and Unlock flags are set to FALSE, the database merely performs a syntax check of the update specification.
- Unlike EssBeginUpdate(), which ignores input rows (records) after an improper input row, EssBeginDataload() processes the remaining input rows, and commits them if appropriate.
- EssEndDataload() returns a linked list of errors in ESS_MBRERR_T.

Access

EssBeginDataload() requires the caller to have write privilege (ESS_PRIV_WRITE) to the active database.

Example

    ESS_STS_T     sts = ESS_STS_NOERR;
    ESS_BOOL_T    Store;
    ESS_BOOL_T    Unlock;
    ESS_STR_T     Query1, Query2;
    ESS_PMBRERR_T pMbrErr;

       Store  = ESS_TRUE;
       Unlock = ESS_FALSE;
       Query1 = "Year Market Scenario Measures Product 12345";
       Query1 = " Jan  East  Scenario Measures Coke  125";

       /* Begin Update */
       sts = EssBeginDataload (hCtx, Store, Unlock, ESS_FALSE, ESS_NULL);

       /* Send update specification */
       if(!sts)
          sts = EssSendString(hCtx, Query1);
          sts = EssSendString(hCtx, Query2);

       /* End Update */
       if(!sts)
          sts = EssEndDataload(hCtx, &pMbrErr);

See Also

EssSendString()
EssEndDataload()
EssBeginUpdate()
EssEndUpdate()
EssUpdate()
EssImport()