Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

 

Code Block
languagecpp
themeConfluence
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

...

persistant

TypeNameComment
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

  • In: The index of the aggregate element to start reading from. The index of the first element in the actual aggregate will always be indexed zero, regardless of the aggregate type. Hence the legal index range is: 0<= index < number of elements in the aggregate.
  • Out: The index of the "last returned matching element". This argument enables the caller to search for elements in an incremental way by specifying this returned "index value plus one" as the input to the next edmiSelectAggrInstances function and so on.
SdaiInteger

hits

  • In: Specifies the maximum number of matching elements to return. If this number is greater than the limitation specified by the <maxBufferSize> argument, then the maximum number of hits will be calculated from the <maxBufferSize> argument.
  • Out: The number of matching elements found.
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

...

Insert excerpt
US:_r_EDMInterface
US:_r_EDMInterface
nopaneltrue

Options

...

 

Example

...

 

Code Block
languagecpp
 #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 (Content by label)
showLabelsfalse
showSpacefalse
cqllabel = "model" and parent = "6062220"