Applies outline change files (*.CHG) on the source to a target outline. This function is designed to be used in batch with EssPartitionGetOtlChanges() and can specify a list of change files. This function can be used with filters.
Use this function instead of EssPartitionApplyOtlChangeFile() whenever there exists more then one partition of the same type and the same metadata direction between the application/database pair.
Syntax
ESS_FUNC_M EssPartitionApplyOtlChangeFileEx (hCtx, usFileName, ppszFileName, usDataDirectionType);
Parameter | Data Type | Description |
---|---|---|
hCtx | ESS_HCTX_T | Handle to Essbase API context |
usFileName | ESS_USHORT_T | Number of outline change files |
ppszFileName | ESS_PSTR_T | Array of file names; array size is defined by usFileName |
usDataDirectionType | ESS_USHORT_T | One of the following Direction Type constants: #define ESS_PARTITION_DATA_SOURCE 0x0001 #define ESS_PARTITION_DATA_TARGET 0x0002 |
Notes
EssPartitionGetOltChanges() returns the name of the change file.
Return Value
Returns zero if successful; error code if unsuccessful.
Access
A call to this function requires database designer permission.
Example
ESS_FUNC_M ESS_PartitionApplyOtlChangeFileEx (ESS_HCTX_T hCtx, ESS_HINST_T hInst) { ESS_FUNC_M sts; ESS_STR_T hostname, appname, dbname; ESS_USHORT_T usType, uscnt, dataFlowDir, *dataFlowDirs = ESS_NULL; 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; dataFlowDir = ESS_PARTITION_DATA_SOURCE; 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. usDataDirectionType = dataFlowDir; MetaQuery.MetaFilter.TimeStamp = 0; MetaQuery.MetaFilter.ulDimFilter = uldimfilter; MetaQuery.MetaFilter.ulMbrFilter = ulmbrfilter; MetaQuery.MetaFilter.ulMbrAttrFilter = ulmbrattrfilter; sts = EssPartitionGetOtlChanges(hCtx, &MetaQuery, &MetaChangeFile); if (!sts) sts = EssAlloc(hInst, MetaChangeFile.usFileNum *sizeof(ESS_USHORT_T), &dataFlowDirs); if (!sts) for (uscnt=0;uscnt< MetaChangeFile.usFileNum;uscnt++) dataFlowDirs[uscnt] = dataFlowDir; if (!sts) { sts = EssPartitionApplyOtlChangeFile (hCtx, MetaChangeFile.usFileNum, MetaChangeFile.ppszFileName); printf("EssPartitionApplyOtlChangeFile sts: %ld\n",sts); } if(&MetaChangeFile) EssFree(hInst,&MetaChangeFile); if(&dataFlowDirs) EssFree(hInst, &dataFlowDirs); return(sts); }
See Also