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);
Parameter | Data Type | Description |
---|---|---|
hCtx | ESS_HCTX_T | API context handle. |
pQuery | ESS_PARTOTL_QUERY_T | Change query criteria. |
pChangeFile | ESS_PARTOTL_CHG_FILE_T | Caller allocated change files information structure. |
Notes
Call EssPartitionFreeOtlChanges() to free change file name strings in pChangeFile.
Return Value
Returns zero if successful; error code if unsuccessful.
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, dataFlowDir; 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_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. usDataDirectionType = dataFlowDir; 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