Verifies the local partition definition (specified by ESS_PPARTSLCT_VALIDATE_T) against the corresponding partition definition in pRemoteDDBFilename on the remote server.
Syntax
ESS_FUNC_M EssPartitionValidateDefinition (hCtx, pSelectVerify, pulInvalidComponent, ppInvalidComponent, pRemoteDDBFileName);
Parameter | Data Type | Description |
---|---|---|
hCtx | ESS_HCTX_T | API context handle. |
pSelectVerify | ESS_PARTSLCT_VALIDATE_T | Description of the partition to verify. |
pulInvalidComponent | ESS_PULONG_T | Number of errors and warnings resulting from validation. |
ppInvalidComponent | ESS_PARTDEF_INVALID_T | List of errors and warnings resulting from validation. |
pRemoteDDBFileName | ESS_STR_T | Remote server partition definition file name. |
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 with extension. If the partition definition file is remote, pRemoteDDBFileName must specify the file name without extension (the extension is assumed to be .DDB).
The server uses the following rule to find the partition definition file on the system:
If pSelectVerify->pszFileName = DbName, the server looks for DbName.DDN.
If pSelectVerify->pszFileName != DbName, the server looks for pSelectVerify->pszFileName.DDB.
Return Value
Returns zero if successful; error code if unsuccessful.
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_PARTSLCT_VALIDATE_T SelectVerify; ESS_PARTDEF_INVALID_T *pInvalidComponent; ESS_ULONG_T ulInvalidComponentCount = 0; ESS_STR_T pRemoteDDBFileName = "src"; /* assume, logged into target database */ memset(&SelectVerify, 0, sizeof(ESS_PARTSLCT_VALIDATE_T)); SelectVerify.usLoc = ESS_FILE_SERVER; SelectVerify.pszFileName = "trg"; SelectVerify.Part.usType = ESS_PARTITION_OP_REPLICATED; SelectVerify.Part.usDirection = ESS_PARTITION_DATA_TARGET; SelectVerify.Part.HostDatabase.pszHostName = "Local" SelectVerify.Part.HostDatabase.pszAppName = "PartSrc"; SelectVerify.Part.HostDatabase.pszDbName = "Src"; sts = EssPartitionValidateDefinition (hCtx, &SelectVerify, &ulInvalidComponentCount, &pInvalidComponent, pRemoteDDBFileName); 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