edmiCreateInstanceAndPutAttrsBN



SdaiAppInstance edmiCreateInstanceAndPutAttrsBN(SdaiModel         model, 
                                               SdaiString        entityName, 
                                               SdaiInteger       numberAttr, 
                                               /* [SdaiString      attributeName, 
                                               SdaiPrimitiveType valueType, 
                                               void              attributeValue]*/ 
                                                . . .); /* values */ 

This operation creates an entity instance and optionally set the specified attribute values of the created instance. This operation is only applicable to data models. The actual data model must be open for write access, before this operation can be successfully performed.

Arguments


TypeNameComment
SdaiModel

model

A numeric modelID that uniquely identifies the model in the EDMdatabase in which the instance is created.

SdaiString

entityName

Name of the ENTITY that defines the instance type to create. ENTITY names are case insensitive. The ENTITY must be defined in the schema that is the underlying schema of the model specified by the model argument.

SdaiInteger

numberAttr

An integer number that specifies the number of attribute values to put in the operation.


values

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

  1. SdaiString <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. SdaiPrimitiveType <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. void <attributeValue>: The data value to assign to the actual attribute in the specified instance. The type of <attributeValue>must be the same as specified in the <valueType> argument.

Return Value




TypeComment
SdaiAppInstance

Options


  


Example



 SdaiAppInstance myPoint;
 SdaiModel model;
 ...
 myPoint = edmiCreateInstanceAndPutAttrsBN (model,
 "Point", 
 3, 
 "x", sdaiREAL, 0.0, 
 "y", sdaiREAL, 0.0, 
 "z", sdaiREAL, 0.0); 
 if (! myPoint) {
 /* Error in operation */ 
 printf("\nError in edmiCreateInstanceAndPutAttrsBN: %s\n", 
 edmiGetErrorText(sdaiErrorQuery())); 
 goto error; 
 }
 ...


See also

Filter by label

There are no items with the selected labels at this time.