Reads an attribute from the EDM Server.
Equivalent to sdaiGetAttrBN, but refers to the EDM Server database. This function may only be invoked from thick clients.
Header:
#include "sdai.h"
Prototype:
EdmiError edmiServGetAttrBN(SdaiInstance instance,
SdaiString attributeName,
SdaiPrimitiveType valueType,
void *value);
Arguments:
instance |
A numeric id that uniquely identifies an instance in the EDMdatabase operated by the EDM Server. |
attributeName |
The name of the attribute to read. In the cases of multipple attribute inheritance, the attribute name must be qualified with the entity name of the supertype from which the attribute was inherited. |
valueType |
An SdaiPrimitiveType that is assignment compatible with the declared attribute type in the related EXPRESS schema. See decalaration of SdaiPrimitiveType in file sdai.h. |
value |
The value to assign to <attributeName> in <instance>. The type of <value> must be the same as specified in <valueType>. |
Returns:
A completion code of datatype EdmiError is the returned function value. The completion code has the following values:
Completion code = 0 : Operation successfully performed.
Completion code != 0: Error in operation. Completion code is an EDMinterface error code. Use edmiGetErrorText to get the error text corresponding to the error code.
EXAMPLE
EdmiError rstat;
SdaiInstance myInstId;
SdaiInteger myInt;
SdaiPrimitiveType myType;
. . .
myType = sdaiINTEGER;
if (rstat = edmiServGetAttrBN(myInstId, "NAME", myType, &myInt)) {
/* Error in operation */
printf("\nError %d in edmiServGetAttrBN : %s \n", rstat,
edmiGetErrorText(rstat));
goto error;
}
. . .