OpenWhere(Params: IMetabaseObjectParamValues; Where: String): IDatasetInstance;
Params. Parameter values for opening data source. Null if parameters are absent.
Where. The condition of filtering used at opening.
The OpenWhere method opens a data source, using the specified filtering condition.
Executing the example requires that the repository contains a query with the Query_1 identifier. The output data set that returns the query during the execution must contain the F_VALUE field with numeric values.
Add links to the Db and Metabase system assemblies.
Sub UserProc;
Var
MB: IMetabase;
MObj: IMetabaseObject;
DSInst: IDatasetInstance;
DSModel: IDatasetModel;
Fields: IDatasetInstanceFields;
Field: IDatasetInstanceField;
Begin
MB := MetabaseClass.Active;
MObj := MB.ItemById("Query_1").Bind;
DSModel := MObj As IDatasetModel;
DSInst := DSModel.OpenWhere(Null, "F_VALUE>200");
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;
DSInst.Close;
End Sub UserProc;
After executing the example the query opens. The output data set will contain only the records, in which value of the F_VALUE field is greater than 200. The obtained data will be displayed in the development environment console.
See also: