sdaiValidateAggrUniqueness


Note: This function can only be used with the EDMmodelChecker license key fully installed.
Checks that no aggregates owned by the specified instance violate an uniqueness constraint. All SET aggregates have per definition an uniqueness constraint, i.e. all elements in a SET aggregate must have different values. Aggregates of type ARRAY and LIST have an uniqueness constraint when the actual aggregate declaration in the related EXPRESS schema contains the optional keyword UNIQUE.
This operation is applicable only to application instances.
The model that holds the actual instance must be open before this operation can be successfully performed.
Related functions: sdaiValidateInstance edmiValidateInstance , edmiValidateInstanceType , edmiValidateInstanceTypeBN , edmiValidateModel , edmiValidateModelBN
Header:
#include "sdai.h"
Prototype:
SdaiLogical sdaiValidateAggrUniqueness(SdaiAppInstance instance);
Arguments:

instance

A numeric instanceID that uniquely identifies the instance of interest in the EDMdatabase, that is the instance that owns all aggregates to be checked for violation of an uniqueness constraint.
The instanceID is defined by a sdaiCreateInstance or a sdaiCreateInstanceBN function.

Returns:
A SdaiLogical value that has the following value:
sdaiTRUE : No aggregates owned by the specified instance violates an uniqueness constraint.
sdaiFALSE: At least one of the aggregates owned by the specified instance violates an uniqueness constraint.
sdaiUNKNOWN: Use sdaiErrorQuery to check for error in operation.
Examples:
SdaiAppInstance anInst;
SdaiLogical result;
...
result = sdaiValidateAggrUniqueness (anInst);
switch (result) {
case sdaiTRUE: 
. . . /* No aggregate uniqueness violation */ 
break; 
case sdaiFALSE: 
. . . /* Aggregate uniqueness violation detected */ 
break; 
default: 
. . . /* Unset elements or possibly errors in operation */ 
}
. . .