...
Invokes the specified EDMquery with the specified arguments on the specified data model. An EDMquery is defined in an EDMquerySchema. An EDMquerySchema is defined in an EDMdatabase by the edmiDefineQuerySchema operation. The execution of an EDMquery is fully performed by the EDMexpressVM.
The result of the EDMquery is returned to the caller. The data required to hold the result data is allocated by the edmiExecuteQuery operation. The operation edmiFreeQueryResult should be invoked by the calling application to free the result data when it is no longer needed.
The result of this operation will be returned as a struct named SdaiQueryResult. See the include file sdai.h for detailed description of this struct
The actual data model must be open before this operation can be successfully performed. If the query is supposed to update the model, the model must be opened for read and write access. See sdaiOpenModel or sdaiOpenModelBN for details.
Powerful trace mechanisms are available for testing and debugging through the "expressions logging", see: edmiDefineExpressionsLog
It is recommended to use the EDMsupervisor and the interactive EDMdebugger to test and debug all Express and Express-X schemata executed by the EDMexpressVM, including EDMquery.
Related functions: edmiExecuteQueryBN , edmiGetQuery , edmiGetQuerySchema , edmiDefineQuerySchema
Header:
#include "sdai.h"
Prototype:
EdmiError edmiExecuteQuery(SdaiModel modelId,
SdaiQuery queryId,
SdaiInteger arguments,
SdaiInteger options,
SdaiQueryResult *queryResult,
/* For each query argument:
[SdaiPrimitiveType argumentDataType,
value] */
... );
Arguments:
modelId | A numeric modelID that uniquely identifies the data model in the EDMdatabase to run the specified EDMquery on. |
queryId | A numeric queryId that uniquely identifies the EDMquery of interest in the EDMdatabase . |
arguments | Number of arguments supplied to the actual EDMquery function. |
options | Specifies the options to be used in the invocation of the EDMquery function. The <options> value can be specified as a bitwise OR between the actual options to enable. All option names are defined on the header file sdai.h . |
queryResult | Address of a variable that will receive the result of the operation. The received result will be of data type SdaiQueryResult. |
argument_values | For each arguments the following pair of data must be supplied:
maximum number of arguments is 64 |
Option Description
RESULT_AS_ID | Specifies that the result of the edmiExecuteQuery operation should be returned as aggregateID and not as aggregate contents when sdaiAGGR is the actual data type of the result value. |
RESULT_AS_ID_CONTENTS | Specifies that the result of the edmiExecuteQuery operation should be returned as aggregate contents and not as aggregateID when sdaiAGGR is the EDMquery function data type. |
RESULT_AS_TABLE | Specifies that the result of the edmiExecuteQuery operation should be returned as a table. This option is only valid when the EDMquery result is an aggregate of instances or an aggregate of view instances. |
...