edmiRemotePutAttrs
EdmiError edmiRemotePutAttrs(SdaiServerContext serverContextId, SdaiAppInstance instance, SdaiInteger attributes, SdaiInvocationId *edmiInvocationId, /* [SdaiAttr attributeId, SdaiPrimitiveType valueType,SdaiVoid data] */ ...);
Assigns values to one or more of the attributes of a specified instance. This operation is applicable only to Explicit attributes, not to Inverse or Derive attributes. The attributes are identified by their attributeIds.
Arguments
Type | Name | Comment |
SdaiServerContext | serverContextId | Context identification, from edmiDefineServerContext |
SdaiAppInstance | instance | A numeric instanceID that uniquely identifies an instance in the remote EDMdatabase |
SdaiInteger | attributes | The number of attributes for which to assign values. |
SdaiInvocationId | edmiInvocationId | Currently not used. |
 | values | For each attribute value to assign the three following arguments in the following order have to be specified:
|
Return Value
Error rendering macro 'excerpt-include' : User 'null' does not have permission to view the page 'US:_r_EDMInterface'.
Â
Options
 Â
Â
Example
Â
 #define S_NAT 0 #define S_PHONE 1 #define S_NATTR 2 int i; EdmiError rstat; SdaiServerContext myContext; SdaiInteger index, nHits; SdaiQueryResult qexRes; /* Create Server Context */ rstat = edmiDefineServerContext("MyContext", "Johnny", "Supervisor", "cf37ftr", "TCP", "9090", "MyServerHost", NULL, NULL, NULL, NULL, NULL, &myContext); /* Select all person instances */ rstat = edmiRemoteSelectInstances(myContext, "MyRepository", "MySocialRelations", "Person", NULL, ONLY_INSTANCE_IDS, NULL, NULL, NULL, &index, &nHits, &qexRes, NULL, NULL, NULL, NULL); /* Get nationality and phone number */ for (i=0;i<nHits;i++) { char _phoneNumber[12]; SdaiAttr _attrIds[S_NATTR]; SdaiEnumeration _nationality; SdaiString _phoneNo; /* Get the persons nationality attribute ID */ rstat = edmiRemoteGetAttrDefinitionBN(myContext, "SocialRelations", "Person", "NATIONALITY", &_attrIds[S_NAT], NULL); /* And his phone number attribute ID */ rstat = edmiRemoteGetAttrDefinitionBN(myContext, "SocialRelations", "Person", "PHONE_NO", &_attrIds[S_PHONE], NULL); rstat = edmiRemoteGetAttrs(myContext, qexRes->instanceIds[i], 0, S_NATTR, NULL, __attrIds[S_NAT], sdaiENUMERATION, &_nationality, _attrIds[S_PHONE], sdaiSTRING, &_phoneNo); /* Set correct nationality code */ if (! strcmp(_nationality, "NOR")) { strcpy(_phoneNumber, "+47-"); } else if (! strcmp(_nationality, "SWE")) { strcpy(_phoneNumber, "+44-"); } else if (! strcmp(_nationality, "DEN")) { strcpy(_phoneNumber, "+45-"); } else { strcpy(_phoneNumber, "+??-"); } /* Concatenate the original phone number */ strcat(_phoneNumber, _phoneNo); /* Free allocated strings in the select buffers */ edmiFree(_nationality); edmiFree(_phoneNo); /* Put back the extended phone number */ rstat = edmiRemotePutAttrsBN(myContext, qexRes->instanceIds[i], 1, NULL, &_attrIds[S_PHONE], sdaiSTRING, &_phoneNumber); } edmiFreeQueryResult(qexRes); . . .
Â
See also
Filter by label
There are no items with the selected labels at this time.
Â