EssPartitionApplyOtlChangeFile

Description

EssPartitionApplyOtlChangeFile() applies outline change files (*.CHG)on either the source or target to an outline on the target. This function is designed to be used in a batch with EssPartitionGetOtlChanges() and can specify a list of change files. As shown in the Example below, this function can be used with filters.

Syntax

ESS_FUNC_M EssPartitionApplyOtlChangeFile (hCtx, usFileName, ppszFileName);

ESS_HCTX_T hCtx
ESS_USHORT_T usFileName
ESS_PSTR_T ppszFileName

Parameters

hCtx Handle to Essbase API context
usFileName Number of outline change files
ppFileName Array of file names; array size is defined by usFileName

Return Value

Returns zero if successful; error code if unsuccessful.

Notes

EssPartitionGetOltChanges() returns the name of the change file.

Access

A call to this function requires database designer access privileges.

Example

ESS_FUNC_M ESS_PartitionApplyOtlChangeFile (ESS_HCTX_T hCtx, ESS_HINST_T hInst)
{
   ESS_FUNC_M          sts;
   ESS_STR_T          hostname, appname, dbname;
   ESS_USHORT_T       usType;
   ESS_ULONG_T        uldimfilter=0,ulmbrfilter=0,ulmbrattrfilter=0;
   ESS_PARTOTL_QUERY_T    MetaQuery;
   ESS_PARTOTL_CHG_FILE_T MetaChangeFile;
   ESS_PPART_INFO_T   partitionp   = NULL;
   
   memset(&MetaQuery, 0, sizeof(ESS_PARTOTL_QUERY_T));
   
   hostname = "local";
   appname = "app1";
   dbname = "src1";
   usType = ESS_PARTITION_OP_LINKED;
   uldimfilter     = ESS_DIMCHG_ALL;
   ulmbrfilter     = ESS_PARTITION_OTLMBR_ALL;
   ulmbrattrfilter = ESS_PARTITION_OTLPARTITION_OTLMBRATTR_ALL;
   MetaQuery.HostDatabase.pszHostName   = hostname;
   MetaQuery.HostDatabase.pszAppName    = appname;
   MetaQuery.HostDatabase.pszDbName     = dbname;
   MetaQuery.usOperationType            = usType;
   MetaQuery.MetaFilter.TimeStamp       = 0;
   MetaQuery.MetaFilter.ulDimFilter     = uldimfilter;
   MetaQuery.MetaFilter.ulMbrFilter     = ulmbrfilter;
   MetaQuery.MetaFilter.ulMbrAttrFilter = ulmbrattrfilter;
   
   sts = EssPartitionGetOtlChanges(hCtx, &MetaQuery, &MetaChangeFile);
   
   
   if (!sts)
   {
		
	sts = EssPartitionApplyOtlChangeFile
	(hCtx, MetaChangeFile.usFileNum, MetaChangeFile.ppszFileName);
		
	printf("EssPartitionApplyOtlChangeFile  sts: %ld\n",sts);
		
   }
   if(&MetaChangeFile)  EssFree(hInst,&MetaChangeFile);

   return(sts);
   
}

See Also

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