sdaiPutAttrsBN


Assigns the specified value to the specified Explicit attributes in the specified instance. This operation is applicable only to Explicit attributes, not to Inverse or Derive attributes.
This operation is the same as the sdaiPutAttrBN operation except that this operation can assign values to any number of attributes in one invocation. For each attribute to assign value to the following three arguments must be specified:

  1. <attributeName> : Name of the actual attribute. Attribute names are case insensitive. The attribute name must be qualified with the entity name when the attribute name is not unique within the actual entity.
  2. <valueType> : The specified primitive type <valueType> must be the same or a compatible data type of the actual attribute domain as defined in the attribute declaration in the related EXPRESS schema.

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. The primitive type sdaiSELECT can be used to specify all data types. The primitive type sdaiADB can be used to specify all data types except typed values.
The primitive type sdaiINTEGER is compatible with sdaiREAL, and sdaiBOOLEAN is compatible with sdaiLOGICAL, hence conversion between these compatible data types will be performed when required.
An aggregate, i.e. data type sdaiAGGR is illegal in this operation.

  1. <value> : The data value to assign to the actual attribute in the specified instance. The type of <value> must be the same as specified in the <valueType> argument.

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 , sdaiPutAttrBN , sdaiPutAttrs
Header:
#include "sdai.h"
Prototype:
void sdaiPutAttrsBN(SdaiAppInstance instance,
                     SdaiInteger     numberAttrs,     
                     ...); 
Arguments:

instance

A numeric instanceID that uniquely identifies the application instance in the EDMdatabase.
The instanceID is defined by a sdaiCreateInstance or a sdaiCreateInstanceBN function.

numberAttrs

An integer number that specifies the number of attributes that will be assigned a value in this operation.

values

For each attribute value to assign the three following arguments in the following order have to be specified:

  1. <attributeName>: Name of the actual attribute. Attribute names are case insensitive. The attribute name must be qualified with the entity name when the attribute name is not unique within the actual entity.
  2. <valueType> : The specified primitive type <valueType> must be the same or a compatible data type of the actual attribute domain as defined in the attribute declaration in the related EXPRESS schema.

    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. 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.
    The primitive type sdaiINTEGER is compatible with sdaiREAL, and sdaiBOOLEAN is compatible with sdaiLOGICAL, hence conversion between these compatible data types will be performed when required.
    An aggregate, i.e. data type sdaiAGGR is illegal in this operation.
  3. <value> : The data value to assign to the actual attribute in the specified instance. The type of <value> must be the same as specified in the <valueType> argument.

Returns:
Void – use sdaiErrorQuery to check for error in operation.
Examples:
SdaiInstance anInst;
SdaiErrorCode errCode;
SdaiString attrName_1, attrName_2, attrName_3;
...
sdaiPutAttrsBN(anInst, 3,
"X", sdaiREAL, 0.0,  
"Y", sdaiREAL, 0.0, 
"Z", sdaiREAL, 0.0); 
if (errCode = sdaiErrorQuery()) {
/* Error in operation */ 
printf("\nError: %s in sdaiPutAttrsBN \n", 
edmiGetErrorText(errCode)); 
goto error; 
}
. . .
sdaiPutAttrsBN(instanceId, 3,
attrName_1, sdaiBOOLEAN, sdaiTRUE,  
attrName_2, sdaiINTEGER, 42, 
attrName_3, sdaiINTEGER, 0); 
...