편집

다음을 통해 공유


Query Data type

Version: Available or changed with runtime version 1.0.

Enables you to retrieve data from multiple tables and combine the data in single dataset.

Static methods

The following methods are available on the Query data type.

Method name Description
SaveAsCsv(Integer, Text [, Integer] [, Text]) Saves the resulting data set of a query as a comma-separated values (CSV) file.
SaveAsCsv(Integer, OutStream [, Integer] [, Text]) Saves the resulting data set of a query as a comma separated values (CSV) file.
SaveAsJson(Integer, OutStream) Saves the resulting data set of a query as an .json file.
SaveAsXml(Integer, Text) Saves the resulting data set of a query as an .xml file.
SaveAsXml(Integer, OutStream) Saves the resulting data set of a query as an .xml file.

Instance methods

The following methods are available on instances of the Query data type.

Method name Description
Close() Closes a query data set and returns the query instance to the initialized state. The following code shows the syntax of the CLOSE method. Query is a variable of the Query data type that specifies the query object.
ColumnCaption(Any) Returns the current caption of a query column as a text string.
ColumnName(Any) Returns the name of a query column as a text string.
ColumnNo(Any) Returns the ID that is assigned to a query column in the query definition.
GetFilter(Any) Returns the filters that are set on the field of a specified column in the query. The following code shows the syntax of the GETFILTER method. Query is a variable of the Query data type that specifies the query object.
GetFilters() Returns the filters that are applied to all columns in the query. The following code shows the syntax of the GETFILTERS method. Query is a variable of the Query data type that specifies the query object.
Open() Runs a query object and generates a data set that can be read. The following code shows the syntax of the OPEN method. Query is a variable of the Query data type that specifies the query object.
Read() Reads data from a row in the resulting data set of a query.
SaveAsCsv(Text [, Integer] [, Text]) Saves the resulting data set of a query as comma separated values (CSV)
SaveAsCsv(OutStream [, Integer] [, Text]) Saves the resulting data set of a query as comma separated values (CSV)
SaveAsJson(OutStream) Saves the resulting data set of a query as Json
SaveAsXml(Text) Saves the resulting data set of a query as XML
SaveAsXml(OutStream) Saves the resulting data set of a query as XML
SecurityFiltering([SecurityFilter]) Gets or sets how security filters are applied to the query.
SetFilter(Any, Text [, Any,...]) Sets a filter on a column of a query to limit the records in the resulting data set of a query.
SetRange(Any [, Any] [, Any]) Sets a filter on a range of values on a column of a query data set.
TopNumberOfRows([Integer]) Specifies the maximum number of rows to include in the resulting data set of a query.

Get Started with AL
Developing Extensions