# EssPartitionGetOtlChanges

Description

EssPartitionGetOtlChanges() reads outline changes from a `.CHG` file on a source server and writes them to a `.CHG` file on the target server. This function is designed to be used in a batch with EssPartitionApplyOtlChangeFile(), or interactively with a combination of EssPartitionReadOtlChangeFile() and EssPartitionApplyOtlChangeRecs().

Syntax

    ESS_FUNC_M EssPartitionGetOtlChanges (hCtx, pQuery, pChangeFile);

ESS_HCTX_T | hCtx
ESS_PARTOTL_QUERY_T | pQuery
ESS_PARTOTL_CHG_FILE_T | pChangeFile

Parameters

hCtx | Essbase API context handle.
pQuery | Change query criteria.
pChangeFile | Caller allocated change files information structure.

Return Value

Returns zero if successful; error code if unsuccessful.

Notes

- Call EssPartitionFreeOtlChanges() to free change file name strings in pChangeFile.

Access

A call to this function requires database designer access privileges.

Example

    ESS_FUNC_M  Ess_PartitionGetOtlChanges(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_PARTITION_OTLDIM_ALL;
       ulmbrfilter     = ESS_PARTITION_OTLMBR_ALL;
       ulmbrattrfilter = ESS_PARTITION_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);
       printf("EssPartitionGetOtlChanges   sts: %ld\n",sts);
       if (!sts) {
       printf("\tNumber of meta change file found: %d\n",MetaChangeFile.usFileNum);
       printf("\tName of meta change file found: %s\n",MetaChangeFile.ppszFileName[0]);	 }
       if(&MetaChangeFile)  EssFree(hInst,&MetaChangeFile);

       return(sts);
    }

See Also

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