edmiCreateScratchInstanceAndPutAttrs
daiAppInstance edmiCreateScratchInstanceAndPutAttrs(SdaiEntity entity, SdaiInteger numberAttr, /*[SdaiAttr attribute, SdaiPrimitiveType valueType, void attributeValue] */ ... );
This operation creates a scratch instance and optionally set the specified attribute values of the created instance. Hence this operation is a combination of edmiCreateScratchInstance and sdaiPutAttrs operations. A scratch instance is located in the scratch model, i.e., scratch instances will not be written to the persistent EDMdatabase. All EDMinterface access operations defined for persistent instances are applicable on scratch instances. The scratch model is a volatile model that is deleted when the session is closed or the database is closed. The scratch model can hold instances of any instance types defined by any dictionary models in the EDMdatabase. Each open session has it own unique scratch model, hence the data in a scratch model cannot be shared between concurrent users of an EDMdatabase. The scratch model will implicitly be created and open for write access when the session is opened. The dictionary model that defines the actual <entityId> must be open before this operation can be successfully performed. A scratch instance can be deleted by the sdaiDeleteInstance , edmiDeleteInstanceAndReferences , edmiDeleteAllScratchInstancesOfSchema , edmiDeleteAllScratchInstancesOfSchemaBN operations. All scratch instances are deleted when the open session is closed or when the database is closed.
Arguments
Type | Name | Comment |
SdaiEntity | entity | A numeric entityID that uniquely identifies an entity definition instance in a dictionary model in the EDMdatabase. The entityID is returned by the sdaiGetEntity function. |
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:
|
Return Value
Type | Comment |
SdaiAppInstance |
Options
Example
SdaiEntity personId; SdaiAppInstance instId; SdaiAttr familyNameId, sexId; ... instId = edmiCreateScratchInstanceAndPutAttrs ( personId, 2, familyNameId, sdaiSTRING, "Smith", sexId, sdaiENUMERATION, Male); if (! instId) { /* Error in operation */ printf("\nError in edmiCreateScratchInstanceAndPutAttrs: %s\n", edmiGetErrorText(sdaiErrorQuery())); goto error; } ...
See also
Filter by label
There are no items with the selected labels at this time.