IDatasetModel.OpenWhere

Syntax

OpenWhere(Params: IMetabaseObjectParamValues; Where: String): IDatasetInstance;

Parameters

Params. Data source parameters. Null if parameters are absent.

Where. The condition of filtering used at opening.

Description

The OpenWhere method opens a data source, using the filter condition of which is passed by the Where parameter. Values of data source parameters are passed by Params.

Example

Executing the example requires that the repository contains a query with the Query_1 identifier. The query has one parameter.

Sub Main;

Var

MB: IMetabase;

MObj: IMetabaseObject;

DSInst: IDatasetInstance;

DSModel: IDatasetModel;

Params: IMetabaseObjectParamValues;

Fields: IDatasetInstanceFields;

Field: IDatasetInstanceField;

Begin

MB := MetabaseClass.Active;

MObj := MB.ItemById("Query_1").Bind;

DSModel := MObj As IDatasetModel;

Params := MObj.Params.CreateEmptyValues;

Params.Item(0).Value := "100";

DSInst := DSModel.OpenWhere(Params, "Num2>15");

Fields := DSInst.Fields;

While Not DSInst.Eof Do

For Each Field In Fields Do

Debug.Write(Field.Value + " ");

End For;

Debug.WriteLine("");

DSInst.Next;

End While;

End Sub Main;

After executing the example, query with specified value of the parameter is opened. The data received as a result of query execution and filtered with the condition Num2>15 are displayed in the development environment console.

See also:

IDatasetModel