EssPartitionApplyOtlChangeRecs

Description

Tells the server to apply outline changes to records. Before calling this routine, call EssPartitionReadOtlChangeFile() to read change records. When call this function from a file, you selectively apply records returned by EssPartitionReadOtlChangeFile() by flipping reject flags for each record. This routine synchronizes outlines interactively.

Syntax

ESS_FUNC_M EssPartitionApplyOtlChangeRecs (hCtx, pApplyRecords);

ESS_HCTX_T hCtx;
ESS_PPARTOTL_SELECT_APPLY_T pApplyRecords;

Parameters

hCtx Handle to Essbase API context.
pApplyRecords Records to apply.

Return Value

Returns zero if successful; error code if unsuccessful.

Notes

Access

A call to this function requires database designer access privileges.

Example

ESS_STS_T  ESS_PartitionApplyOtlChangeRecs (ESS_HCTX_T hCtx)
{
   ESS_STS_T			sts = ESS_STS_NOERR;
   ESS_PARTOTL_SELECT_APPLY_T	ApplyRecords;
   ESS_STR_T			chgfilename;
   ESS_TIME_T			time = 0;
   ESS_PARTOTL_CHANGE_API_T	OtlChg;
   ESS_ULONG_T			uldimfilter=0,ulmbrfilter=0,ulmbrattrfilter=0;
   ESS_PARTOTL_SELECT_CHG_T	SelectMetaRecords;
   ESS_PARTOTL_READ_T		MetaChangeRead;


   memset(&ApplyRecords,      0, sizeof(ESS_PARTOTL_SELECT_APPLY_T));
   memset(&SelectMetaRecords, 0, sizeof(ESS_PARTOTL_SELECT_CHG_T));
   memset(&MetaChangeRead,    0, sizeof(ESS_PARTOTL_READ_T));


   chgfilename = "d:\\essbase5\\app\\app1\\trg1\\ess00001.chg";

   uldimfilter      = ESS_DIMCHG_ALL;
   ulmbrfilter      = ESS_PARTITION_OTLMBR_ALL;
   ulmbrattrfilter  = ESS_PARTITION_OTLPARTITION_OTLMBRATTR_ALL;
   

   SelectMetaRecords.pszFileName                 = chgfilename;
   SelectMetaRecords.QueryFilter.TimeStamp       = time;
   SelectMetaRecords.QueryFilter.ulDimFilter     = uldimfilter;
   SelectMetaRecords.QueryFilter.ulMbrFilter     = ulmbrfilter;
   SelectMetaRecords.QueryFilter.ulMbrAttrFilter = ulmbrattrfilter;

   MetaChangeRead.pOtlChg = &OtlChg;

   sts = EssPartitionReadOtlChangeFile (hCtx, &SelectMetaRecords, &MetaChangeRead);

   printf("\tEssPartitionReadOtlChangeFile  sts: %ld\n",sts);

   if (!sts) 
   {  
	  
	  ApplyRecords.pszFileName = chgfilename; 
	  ApplyRecords.pOtlChg = MetaChangeRead.pOtlChg;
	  ApplyRecords.SourceTime = MetaChangeRead.SourceTime;

      sts = EssPartitionApplyOtlChangeRecs(hCtx, &ApplyRecords); 

	  printf("EssPartitionApplyOtlChangeRecs  sts: %ld\n",sts);
   
   }

   sts = EssPartitionFreeOtlChanges(hCtx);

   return(sts);
   
}

See Also

Constant and Structure Definitions for Partitions
EssPartitionApplyOtlChangeFile()
EssPartitionCloseDefFile()
EssPartitionFreeDefCtx()
EssPartitionFreeOtlChanges()
EssPartitionGetAreaCellCount()
EssPartitionGetList()
EssPartitionGetOtlChanges()
EssPartitionGetReplCells()
EssPartitionNewDefFile()
EssPartitionOpenDefFile()
EssPartitionPurgeOtlChangeFile()
EssPartitionPutReplCells()
EssPartitionReadDefFile()
EssPartitionReadOtlChangeFile()
EssPartitionReplaceDefFile()
EssPartitionResetOtlChangeTime()
EssPartitionValidateDefinition()
EssPartitionWriteDefFile()