## EssPartitionValidateDefinition

Description

This routine verifies the partition definition specified by ESS_PPARTSLCT_VALIDATE_T.

Syntax

ESS_FUNC_M EssPartitionValidateDefinition (hCtx, pSelectVerify, pulInvalidComponent, ppInvalidComponent, pRemoteDDBFileName);

ESS_HCTX_T | hCtx;
ESS_PPARTSLCT_VALIDATE_T | pSelectVerify;
ESS_PULONG_T | pulInvalidComponent;
ESS_PPPARTDEF_INVALID_T | ppInvalidComponent;
ESS_STR_T | pRemoteDDBFileName;

Parameters

hCtx | Essbase API context handle.
pSelectVerify | Description of the partition to verify.
pulInvalidComponent | Number of errors and warnings resulting from validation.
ppInvalidComponent | List of errors and warnings resulting from validation.
pRemoteDDBFileName | Remote host partition definition file name.

Return Value

Returns zero if successful; error code if unsuccessful.

Notes

- Call the function EssFree() to free the invalid component when pulInvalidComponent is not 0.
- The remote partition definition file can reside locally or on the remote host.
If the partition definition file is local, pRemoteDDBFileName must specify the full path, including the file name without extension. If the partition definition file is remote, pRemoteDDBFileName must specify the file name without extension.
- The server uses the following rule to find the partition definition file. If pRemoteDDBFileName = DbName, it looks for DbName.DDN. If pRemoteDDBFileName = DbName, it looks for pRemoteDDBFileName.DDB. See EssRenameObject().

Access

A call to this function requires database designer access privileges.

Example

    ESS_STS_T  ESS_PartitionValidateDefinition(ESS_HCTX_T hCtx, ESS_HINST_T hInst)
    {
       ESS_STS_T      sts = 0;
       ESS_STR_T      hostname, appname, dbname, filename;
       ESS_USHORT_T   usType,usdir;
       ESS_USHORT_T   rLoc;

       ESS_PARTSLCT_VALIDATE_T   SelectVerify;
       ESS_PARTDEF_INVALID_T    *pInvalidComponent;
       ESS_ULONG_T               ulInvalidComponentCount = 0;
       ESS_STR_T                 pRemoteDDBFileName = "remotedb";

       memset(&SelectVerify, 0, sizeof(ESS_PARTSLCT_VALIDATE_T));

       rLoc     = ESS_FILE_SERVER;
       filename = "Src1";
       hostname = "local";
       appname  = "App1";
       dbname   = "Trg1";
       usType   = ESS_PARTITION_OP_LINKED;
       usdir    = ESS_PARTITION_DATA_SOURCE;

       SelectVerify.usLoc                              = rLoc;
       SelectVerify.pszFileName                        = filename;
       SelectVerify.Partition.usType                   = usType;
       SelectVerify.Partition.usDirection              = usdir;
       SelectVerify.Partition.HostDatabase.pszHostName = hostname;
       SelectVerify.Partition.HostDatabase.pszAppName  = appname;
       SelectVerify.Partition.HostDatabase.pszDbName   = dbname;

       sts = EssPartitionValidateDefinition (hCtx, &SelectVerify,
           &ulInvalidComponentCount, &pInvalidComponent, &RemoteDDBFileName);

       printf("EssPartitionValidateDefinition  sts:  %ld\n",sts);

       if (ulInvalidComponentCount > 0)
          printf("Validation resulted in warnings and errors.\n");
       else
          printf ("Partition is valid.\n");

       if (pInvalidComponent)
          EssFree(hInst, pInvalidComponent);

       return(sts);
    }

See Also

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