edmiSelectAggrElements
Â
EdmiError edmiSelectAggrElements(SdaiAggr aggrId, SdaiString condition, SdaiInteger options, SdaiInteger maxBufferSize, SdaiInteger *index, SdaiInteger *hits, SdaiInteger *buffer);
Returns buffer with the indexes of all the elements of an aggregate that matches given Express-X conditional statement. This function only handles aggregates with primitive data type elements.
Arguments
Type | Name | Comment |
SdaiAggr | aggrId | The numeric aggregateID that uniquely identifies the aggregate of interest in the EDMdatabase. This may be any type of aggregate, both persistent and scratch with elements of primitive data types. The aggregateID is returned when the aggregate is created or it can be retrieved with an EDMinterface get operation. |
SdaiString | condition | A conditional statement, written in Express-X, that the aggregate elements shall match. References to the element it self is done by the symbol SELF. A string comparing condition may therefore be written "SELF = 'SCHMIDT'" or "SELF LIKE 'SCHMIDT'" or even "xpxLIKE(SELF, 'SCHMIDT')" An empty condition, i.e., <condition> = NULL will match all aggregate elements. All legal symbolic Express-X logical expressions are legal <condition> values. This <condition> argument will be compiled by the EDMexpressXCompiler |
SdaiInteger | options | Not used. |
SdaiInteger | maxBufferSize | Specifies the size (in number of bytes) of the buffer used for receiving matching elements. The number of elements may never exceed the number that fits into a buffer with the size specified in this argument. |
SdaiInteger | index |
|
SdaiInteger | hits |
|
SdaiInteger | buffer | The buffer, allocated by the calling application, that will receive the value of each returned matching element. Use the <maxBufferSize> or <hits> argument to prevent writing outside this buffer. |
Return Value
Options
Â
Example
Â
 #define NOBUFF 1024 int i; EdmiError rstat; SdaiAggr myArrayId; SdaiInteger buff[NOBUFF]; SdaiInteger buffsize = (NOBUFF * sizeof(SdaiInteger)); SdaiInteger index = 0; SdaiInteger nHits = NOBUFF; . . . if (rstat = edmiSelectAggrElements(myArrayId, "SELF = 'SCHMIDT'", 0, buffsize, &index, &nHits, &buff[0])) { printf("\nError %d in edmiSelectAggrElements: %s", rstat, edmiGetErrorText(rstat)); goto err; } if (! nHits) { printf("\nNo persons with the name 'SCHMIDT' found"); }else { printf("\n%d persons found with the name 'SCHMIDT'"); printf("\nLocated in the array element(s) number:"); for (i=0;i<nHits;i++) { printf("%d ", buff[i]); } } . . .
Â
See also
Filter by label
There are no items with the selected labels at this time.
Â