xpxExecuteQuery
FUNCTION xpxExecuteQuery(modelId, queryId : GENERIC; arguments, options : INTEGER; VAR queryResultIndex : GENERIC; VAR queryResult : GENERIC; argument1, . . ., argumentN : GENERIC) status : INTEGER;
The xpxExecuteQuery function 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 xpxDefineQuerySchema 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 xpxExecuteQuery operation. The operation xpxFreeQueryResult should be invoked by the calling application to free the result data when it is no longer needed. 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 open for read and write access. See xpxOpenModel or xpxOpenModelBN for details. 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.
It is strongly advised to use the following functions for nested query levels
Arguments
Type | Name | Comment |
GENERIC | modelId | A numeric modelID that uniquely identifies the data model in the EDMdatabase to run the specified EDMquery on. |
GENERIC | queryId | A numeric queryId that uniquely identifies the EDMquery of interest in the EDMdatabase . |
INTEGER | arguments | Number of arguments supplied to the actual EDMquery function. This number should correspond to signature of the actual EDMquery function, i.e., the <arguments> should correspond to the number of formal parameters in the actual EDMquery function declaration in the EDMquerySchema. |
INTEGER | options | see below |
GENERIC | queryResultIndex | |
GENERIC | queryResult |
|
GENERIC | argument(N) |
Return Value
Options
Option | Comment |
XPXRESULT_AS_ID | Specifies that the result of the xpxExecuteQuery operation should be returned as aggregateID and not as aggregate contents when sdaiAGGR is the actual data type of the result value. The actual aggregateID is returned in the element data.value.aggrVal in the returned SdaiQueryResult struct. The declared return value (function value) of the actual EDMquery function defines the legal data type of the result value. RESULT_AS_ID is the default option value. |
XPXRESULT_AS_ID_CONTENTS | Specifies that the result of the xpxExecuteQuery operation should be returned as aggregate contents and not as aggregateID when sdaiAGGR is the EDMquery function data type. This means that the result will be a table with one column and number of rows equal to the number of elements in the aggregate. |
XPXRESULT_AS_TABLE | Specifies that the result of the xpxExecuteQuery 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. The number of elements in the aggregate will be the number of rows in the table and the number of attributes in the actual instance type or view type will be the number of columns in the table. |
Example
<Missing Example>
See also
Filter by label
There are no items with the selected labels at this time.