EssImport

Allows importing data from different sources to the Essbase Server.

Syntax

ESS_FUNC_M EssImport (hCtx, pRules, pData, ppMbrErr, pMbrUser, abortOnError);
ParameterData TypeDescription

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:

  • ESS_MBRERR_BADDIM

  • ESS_MBRERR_BADGEN

  • ESS_MBRERR_UNKNOWN

  • ESS_MBRERR_BADACCESS

  • ESS_MBRERR_BADSYNTAX

pMbrUser

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.

abortOnError

ESS_USHORT_T

If TRUE, import stops on the first error. Otherwise, it continues.

Notes

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

ESS_FUNC_M
ESS_Import(ESS_HCTX_T hCtx)
{
   ESS_FUNC_M     sts = ESS_STS_NOERR;
   ESS_SHORT_T   isAbortOnError;
   ESS_OBJDEF_T  Rules;
   ESS_OBJDEF_T  Data;
   ESS_MBRUSER_T User;                 
   ESS_PMBRERR_T pMbrErr = NULL;
      
   Data.hCtx      = hCtx;
   Data.AppName   = "Olap";
   Data.DbName    = "Demo";
   Data.ObjType   = ESS_OBJTYPE_TEXT;   
   Data.FileName  = "Actuals";          
   
   Rules.hCtx     = hCtx;
   Rules.AppName  = "Olap";
   Rules.DbName   = "Demo";
   Rules.ObjType  = ESS_OBJTYPE_RULES;     
   Rules.FileName = "Actmap";           
   /**********************/   
   /* Running conditions */
   /**********************/
   isAbortOnError = ESS_TRUE;
   
   sts = EssImport (hCtx, &Rules, &Data, &pMbrErr,
         NULL, isAbortOnError);
   if(pMbrErr)
      EssFreeMbrErr(hCtx, pMbrErr);
   /*******************************************************************/
   /*                                                                 */
   /* When a SQL data source is defined in the rules file, define     */
   /* the variables in the ESS_OBJDEF_T Data structure as follows:    */
   /*    Data.hCtx     = hCtx;                                        */
   /*    Data.AppName  = NULL;                                        */
   /*    Data.DbName   = NULL;                                        */
   /*    Data.ObjType  = ESS_OBJTYPE_NONE;                            */
   /*    Data.FileName = NULL;                                        */
   /*                                                                 */
   /* Also, provide strings for the variables in the ESS_MBRUSER_T    */
   /* User structure; for example:                                    */
   /*    User.User     = "Dbusernm";                                  */
   /*    User.Password = "Dbpasswd";                                  */
   /*                                                                 */
   /* Use a blank string for User and Password, if the SQL source     */ 
   /* does not require user and password information; for example:    */
   /*    User.User     = "";                                          */
   /*    User.Password = "";                                          */
   /*                                                                 */
   /* Also, define sts as follows:                                    */
   /*    sts =  EssImport (hCtx, &Rules, &Data, &pMbrErr,             */
   /*           &User, isAbortOnError);                               */
   /*                                                                 */
   /*******************************************************************/ 
}

See Also