# EssPartitionGetList

Description

EssPartitionGetList() returns a list of the partition definitions in which the currently selected database participates.

Syntax

    ESS_FUNC_M EssPartitionGetList (hCtx, pSelectPartition, pusCount, ppPartition);

ESS_HCTX_T | hCtx
ESS_PARTSLCT_T | pSelectPartition
ESS_PUSHORT_T | pusCount
ESS_PPPART_INFO_T | ppPartition

Parameters

hCtx | Essbase API context handle.
pSelectPartition | Criteria to select partitions.
pusCount | Count of partitions returned.
ppPartition | Pointer to allocated array of partition information structures.

Return Value

Returns zero if successful; error code if unsuccessful.

Example

    ESS_FUNC_M ESS_PartitionGetList(ESS_HCTX_T hCtx, ESS_HINST_T hInst)
    {
       ESS_FUNC_M		sts       = ESS_STS_NOERR;
       ESS_USHORT_T		op_types  = 0;
       ESS_USHORT_T		dir_types = 0;
       ESS_USHORT_T		meta_dir_types = 0;
       ESS_USHORT_T		count, i;
       ESS_PPART_INFO_T	partitionp   = NULL;
       ESS_PARTSLCT_T       SelectPartition;
       memset(&Selectpartition, 0, sizeof(ESS_PARTSLCT_T));

       op_types = 	ESS_PARTITION_OP_REPLICATED |
    		ESS_PARTITION_OP_LINKED |
    		ESS_PARTITION_OP_TRANSPARENT;

       dir_types = ESS_PARTITION_DATA_SOURCE | ESS_PARTITION_DATA_TARGET;

       meta_dir_types = ESS_PARTITION_OTL_SOURCE | ESS_PARTITION_OTL_TARGET;

       SelectPartition.usOperationTypes = op_types;
       SelectPartition.usDirectionTypes = dir_types;
       SelectPartition.usMetaDirectionTypes = meta_dir_types;

       sts = EssPartitionGetList(hCtx, &SelectPartition, &count, &Partitionp);
       printf("EssPartitionGetList  sts:  %ld\n",sts);
       if (!sts)
       {
       printf("\n# Partitions matching input criteria: %d\n\n", (int)count);

       for (i = 0; i < count; i++)
       {
          ESS_PART_INFO_T *info = &partitionp[i];

          printf("%2d: %s %s %s: Host=%s App=%s Db=%s\n", i+1,
                  info->OperationType==ESS_PARTITION_OP_REPLICATED ? "Replication" :
                  info->OperationType==ESS_PARTITION_OP_LINKED ? "Link" :
                  info->OperationType==ESS_PARTITION_OP_TRANSPARENT ? "Transparent" : "Unknown",
                  info->DataDirection==ESS_PARTITION_DATA_SOURCE ? "Source" :
                  info->DataDirection==ESS_PARTITION_DATA_TARGET ? "Target" :"Unknown",
                  info->MetaDirection==ESS_PARTITION_OTL_SOURCE ? "(Outline Change Source)":
                  info->MetaDirection==ESS_PARTITION_OTL_TARGET ? "(Outline Change Target)" :"(Unknown Outline Change Type)",
                  info->SvrName, info->AppName, info->DbName);
          printf("    Outline last changed: %s\n",
                     info->LastMetaUpdateTime==0 ? "Never\n"
                                                 : ctime(&info->LastMetaUpdateTime));
          if (info->OperationType==ESS_PARTITION_OP_REPLICATED &&
              info->DataDirection==ESS_PARTITION_DATA_TARGET)
          {
             printf("    Last replicated: %s    %s\n",
                     info->LastRefreshTime==0 ? "Never\n"
                                              : ctime(&info->LastRefreshTime),
                     info->PartitionUpdatable ? "Locally updatable" :
                                             "Not locally updatable");
          }
          else if (info->OperationType==ESS_PARTITION_OP_REPLICATED &&
                   info->DataDirection==ESS_PARTITION_DATA_SOURCE)
          {
             printf("    Last updated: %s    %s\n\n",
                     info->LastUpdateTime==0 ? "Never\n"
                                             : ctime(&info->LastUpdateTime),
                     info->IncrRefreshAllowed ? "Incrementally replicatable" :
                                                "Not incrementally replicatable");
          }
       }#/* end for */
       }#/* end if */
       if (partitionp) EssFree(hInst, partitionp);
       return(sts);
    }

See Also

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