edmiRemoteDeleteInstance
EdmiError edmiRemoteDeleteInstance(SdaiServerContext serverContextId, SdaiAppInstance instance, SdaiOptions options, SdaiInvocationId *edmiInvocationId);
Deletes an application instance from the remote EDMdatabase. Any data, included aggregates, owned by the actual instance will be deleted. An instance may not normally be deleted if it is externally referenced from one or more instances. Any external references to the instance must be deleted before this operation can be successfully performed. The function edmiRemoteDeleteInstanceReferences can be used to delete all the external references to an instance, or the references can be deleted one by one by the appropriate operations. This operation is applicable only to application instances. The instanceID of the deleted instance will not be reused before the edmModel that contained the instance is deleted.
Arguments
Type | Name | Comment |
SdaiServerContext | serverContextId | Context identification, from edmiDefineServerContext |
SdaiAppInstance | instance | The numeric instanceID that uniquely identifies the instance in the remote EDMdatabase |
SdaiOptions | options | See description of available options below. |
SdaiInvocationId | edmiInvocationId | Currently not used. |
Return Value
Options
Option | Comment |
DELETE_INSTANCE_REFERENCES | All instances that are referenced from the instance to be deleted will be deleted as well. This option makes the operation deep. |
Example
EdmiError rstat; SdaiServerContext myContext; SdaiInteger index, nHits; SdaiQueryResult qexRes; SdaiInstance personId; /* Create Server Context */ rstat = edmiDefineServerContext("MyContext", "Johnny", "Supervisor", "cf37ftr", "TCP", "9090", "MyServerHost", NULL, NULL, NULL, NULL, NULL, &myContext); /* Get a persons instance Id from a unique primary key attribute 'PID' */ nHits = 1; index = 0; rstat = edmiRemoteSelectInstances(myContext, "DataRepository", "SocialRelations", "Person", "PID = '16126353127'", (ONLY_INSTANCE_IDS | SUBTYPES), NULL, NULL, NULL, &index, &nHits, &qexRes, NULL, NULL, NULL, NULL); if (!nHits) { printf("\nRequested pid not found."); goto err; } personId = qexRes->instanceIds[0]; /* Delete all references to personId */ rstat = edmiRemoteDeleteInstanceReferences(myContext, personId, NULL); /* Delete the instance it self */ rstat = edmiRemoteDeleteInstance(myContext, personId, 0, NULL); . . .
See also
Filter by label
There are no items with the selected labels at this time.