xpxExecuteQueryBN
FUNCTION xpxExecuteQueryBN(modelId : GENERIC; querySchemaName, queryName : STRING; arguments, options : INTEGER; VAR queryResultIdex : GENERIC; VAR queryResult : GENERIC; argument1, . . . , argumentN : GENERIC) status : INTEGER;
The xpxExecuteQueryBN 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
1 | Type | Name | Comment |
2 | GENERIC | modelId | A numeric modelID that uniquely identifies the data model in the EDMdatabase to run the specified EDMquery on |
3 | STRING | querySchemaName | Specifies the name of the EDMquerySchema that defines the EDMquery of interest. This query schema must exist in the EDMdatabase. Query schema names are case insensitive. |
4 | STRING | queryName | Specifies the name of an EDMquery function that should be invoked. EDMquery names are case insensitive. |
5 | 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. maximum number of arguments is 64 |
6 | INTEGER | options | see below |
7 | GENERIC | queryResultIdex | Â |
8 | GENERIC | queryResult | Address of a variable that will receive the result of the operation. The received result will be of data type SdaiQueryResult. |
9 | 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.
Â