EssBeginStreamBuildDim

Starts the dimension build process.

This function must be called before EssEndStreamBuildDim(). After calling EssBeginStreamBuildDim(), call EssSendString() to send source records to Essbase server.

Syntax

ESS_FUNC_M EssBeginStreamBuildDim (hCtx, RulesObj, usBuildOption, szTmpOtlFilename)
ParameterData TypeDescription

hCtx

ESS_HCTX_T

API context handle.

RulesObj

ESS_POBJDEF_T

Pointer to rules file object definition structure.

usBuildOption

ESS_USHORT_T

Valid values:

  • ESS_INCDIMBUILD_BUILD

    Build members only.

  • ESS_INCDIMBUILD_VERIFY

    Build members and verify the outline.

  • ESS_INCDIMBUILD_SAVEOTL

    Build members and save the outline to a temp outline file.

  • ESS_INCDIMBUILD_ALL

    Build members, verify the outline, and restructure.

szTmpOtlFilename

ESS_STR_T

The temp outline file name. Essbasecreates a temporary outline file with extension "otb" if the resulting outline in this round of dimension build has outline verification errors.

Notes

Unicode clients using the C Main API to communicate with Unicode-enabled Essbase applications must send the UTF-8 encoded Unicode byte order mark (BOM) in the text stream immediately after calling this function. For an example, see Specifying the Byte Order Encoding.

Return Value

Returns zero if successful; error code if unsuccessful.

Example

ESS_FUNC_M
ESS_IncBuildDim( ESS_HCTX_T hCtx)
{
	ESS_STS_T     sts = 0;
	ESS_OBJDEF_T  RulesObj;
	ESS_OBJDEF_T  DataObj;
	ESS_STR_T     ErrorName;
	ESS_APPNAME_T appname;
	ESS_DBNAME_T  dbname;

   memset(&RulesObj,0,sizeof(ESS_OBJDEF_T));
   memset(&DataObj,0,sizeof(ESS_OBJDEF_T));
   strcpy(appname, "sample");
   strcpy(dbname,"basic");

   RulesObj.hCtx     = hCtx;
   RulesObj.FileName = "genref"; 
   RulesObj.AppName  = appname;
   RulesObj.DbName   = dbname;
   RulesObj.ObjType  = ESS_OBJTYPE_RULES;  
   
   DataObj.hCtx      = hCtx;
   DataObj.FileName  = "genref";
   DataObj.AppName   = appname;
   DataObj.DbName    = dbname;
   DataObj.ObjType   = ESS_OBJTYPE_TEXT;    
    
   ErrorName         = "builddim.err";
   
   sts = EssBeginIncrementalBuildDim(hCtx);

   if (!sts)
      sts = EssIncrementalBuildDim(hCtx,&RulesObj,&DataObj,NULL,ErrorName,true,ESS_INCDIMBUILD_BUILD,NULL);
   if (!sts)
      sts = EssIncrementalBuildDim(hCtx,&RulesObj,&DataOb,NULL,ErrorName,true,ESS_INCDIMBUILD_VERIFY,NULL);
   if (!sts)
      sts = EssIncrementalBuildDim(hCtx,&RulesObj,&DataOb,NULL,ErrorName,true,ESS_INCDIMBUILD_SAVEOTL,"tmpotl");


   sts = EssBeginStreamBuildDim(hCtx, &RulesObj,ESS_INCDIMBUILD_BUILD,"tmpotl");
   if (!sts)
      sts = EssSendString(hCtx, "600	600-20	600-20-20\n");
   if (!sts)
      sts = EssSendString(hCtx, "600	600-20	600-20-30\n");
   if (!sts)
      sts = EssSendString(hCtx, "600	600-40	600-40-20\n");
   sts = EssEndStreamBuildDim(hCtx,ErrorName,false);


   sts = EssEndIncrementalBuildDim(hCtx,ESS_DOR_ALLDATA,"tmpotl",ErrorName,false);
   return sts;
}

See Also