sdaiPutAttrBN
Assigns the specified value to the specified Explicit attribute in the specified instance. This operation is applicable only to Explicit attributes, not to Inverse or Derive attributes.
The data type, i.e. primitive type of the value, and the data value to be assigned to the actual attribute in the specified instance are specified as arguments to this function.
The data type specified in the <valueType> argument must be the same or a compatible type to the actual attribute domain defined in the attribute declaration in the EXPRESS schema that defines the actual attribute. All data types except sdaiAGGR can be handled by this operation. Aggregates cannot be assigned as attribute data value by this operation. Aggregates must be assigned to attributes by either sdaiCreateAggr or sdaiCreateAggrBN operations.
This operation is only applicable to Explicit attributes in application instances.
The model that holds the actual instance must be open for write access before this operation can be successfully performed.
Related functions: sdaiPutAttr , sdaiPutAttrs , sdaiPutAttrsBN
Header:
#include "sdai.h"
Prototype:
void sdaiPutAttrBN(SdaiAppinstance appinstance,
SdaiString attributeName,
SdaiPrimitive valueType,
...);
Arguments:
appinstance |
A numeric instanceID that uniquely identifies the application instance in the EDMdatabase that will receive the new attribute value. |
attributeName |
Name of the attribute that will receive the specified value. Attribute names are case insensitive. The attribute name must be qualified with the entity name when the attribute name is not unique within the entity. |
valueType |
The data type, i.e. the primitive type of the data value to assign to the specified attribute in the specified instance. This <valueType> must be the same or a compatible type of the attribute domain as defined in the related EXPRESS schema. The primitive type sdaiSELECT can be used to write all data types. The primitive type sdaiADB can be used to write all data types except typed values. |
value |
The actual value to assign to the specified attribute in the specified instance. The type of <value> must be the same as specified by the <valueType> argument. |
Returns:
Void – use sdaiErrorQuery to check for error in operation.
Example:
SdaiAppinstance aPoint;
...
sdaiPutAttrBN(aPoint, "X", sdaiREAL, 0.0);
if (errCode = sdaiErrorQuery()) {
/* Error in operation */
printf("\nError: %s in sdaiPutAttrBN \n",
edmiGetErrorText(errCode));
goto error;
}
. . .