edmiRemoteWriteAggrElements
EdmiError edmiRemoteWriteAggrElements(SdaiServerContext serverContextId, SdaiAggr aggrId, SdaiAggrFunction aggrFunction, SdaiAggrIndex elementIndex, SdaiInteger elements, SdaiPrimitiveType datatype, SdaiVoid dataValues, SdaiInvocationId *edmiInvocationId);
Writes values contained in a memory buffer to elements of an aggregate of any type.
- ARRAY: The argument <elementIndex> specifies the index of the first array element to write into. The argument <elements> specifies the number of values to write from the <dataValues> buffer to the ordered array aggregate.
- LIST: The values in the <dataValues> will be appended, prepended or inserted into the ordered list aggregate.
- BAG and SET: The values in the <dataValues> buffer will be added to the unordered aggregate.
Arguments
Type | Name | Comment |
SdaiServerContext | serverContextId | Context identification, from edmiDefineServerContext |
SdaiAggr | aggrId | The numeric aggregateID that uniquely identifies the aggregate of interest in the remote EDMdatabase |
SdaiAggrFunction | aggrFunction | Legal operations on aggr elements are:
|
SdaiAggrIndex | elementIndex | The index of the first ARRAY element to write to. The legal index range for an ARRAY is [L <= index < U] where L is the lower index and U is the upper index in the ARRAY declaration within the underlying Express Schema. |
SdaiInteger | elements | The number of elements to write to the aggregate. |
SdaiPrimitiveType | datatype | The data type (primitive type) of the elements to write into the aggregate The value of this argument must be one of the following legal data types: sdaiINTEGER, sdaiREAL, sdaiBOOLEAN, sdaiLOGICAL, sdaiSTRING, sdaiENUMERATION, sdaiBINARY, sdaiAGGR, sdaiINSTANCE or sdaiSELECT |
SdaiVoid | dataValues | The address of the memory buffer that contains the elements to write into the aggregates. |
SdaiInvocationId | edmiInvocationId | Currently not used. |
Return Value
Options
Example
/* SCHEMA DentalStatus; ENTITY Tooth; Fillings : INTEGER; END_ENTITY; ENTITY Incisor SUBTYPE OF (Tooth); END_ENTITY; ENTITY Canin SUBTYPE OF (Tooth); END_ENTITY; ENTITY Molar SUBTYPE OF (Tooth); END_ENTITY; ENTITY Wisdom SUBTYPE OF (Molar); END_ENTITY; ENTITY Patient; CustomerId : INTEGER; ToothSet : ARRAY [1:32] OF OPTIONAL Tooth; END_ENTITY; END_SCHEMA; */ EdmiError rstat; SdaiServerContext myContext; SdaiModel modelId; SdaiInteger nHits, index; SdaiInstance patientId, molarId; SdaiAggr toothSet; /* Define Remote Server Context */ rstat = edmiDefineServerContext("MyRemoteServerContext", "Johnny", "Dentist", "cf37ftr", "TCP", "9090", "MyServerHost", NULL, NULL, NULL, NULL, NULL, &myContext); /* Get the modelId of the patient register model */ rstat = edmiRemoteGetModelBN(myContext, "DataRepository", "PatientRegister", &modelId, NULL); /* Get the instance Id of the patient with customerId 8745 */ nHits = 1; index = 0; rstat = edmiRemoteFindInstancesBN(myContext, modelId, "Patient", "CustomerId = 8745", sizeof(SdaiInstance), &index, &nHits, &patientId, NULL); /* Get the patients toothset */ rstat = edmiRemoteGetAttrsBN(myContext, patientId, 0, 1, NULL, "ToothSet", sdaiAGGR, &toothSet); /* The patients has got a new wisdom molar */ rstat = edmiRemoteCreateInstanceAndPutAttrsBN(myContext, "DataRepository", "PatientRegister", "Wisdom", 1, &molarId, NULL, "Fillings", sdaiINTEGER, 0); /* Insert the patients new upper right wisdom molar (toothSet element 16) into his toothSet */ rstat = edmiRemoteWriteAggrElements(myContext, toothSet, ACCESS_BY_INDEX, 16, 1, sdaiINSTANCE, &molarId, NULL); . . .
See also
Filter by label
There are no items with the selected labels at this time.