EssImport

Description

EssImport() allows importing data from different sources to the Essbase server.

Syntax

ESS_FUNC_M EssImport (hCtx, pRules, pData, ppMbrErr, pMbrUser, abortOnError);
ESS_HCTX_ThCtx
ESS_POBJDEF_T pRules
ESS_POBJDEF_T pData
ESS_PPMBRERR_T ppMbrErr
ESS_PMBRUSER_T pMbrUser
ESS_USHORT_TabortOnError

Parameters

hCtxEssbase API context handle.
pRulesPointer to the rules file object definition structure.
pDataPointer to the data file object definition structure.
ppMbrErrPointer 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
pMbrUserPointer to the SQL user structure (if data source is a SQL database). A NULL SQL user structure indicates a non SQL data source.
AbortOnErrorIf TRUE import stops on the first error otherwise continues.

Return Value

Returns zero, if successful. Otherwise, returns an error code.

Notes

Access

This function requires the caller to have database design 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

EssExport()
EssBuildDimension()
EssFreeMbrErr()