Query Properties
Within a query, you can set properties on the query itself, the data sources, the fields that are used for sorting, and the ranges that are used to delimit the query.
Query properties determine the overall behavior of the query. For example, it is possible to determine which form should be displayed to allow users to interact with the query.
|
Property |
Description |
|---|---|
|
Name |
Specifies the name of the query. |
|
Title |
Heading for the query. |
|
Form |
Determines which query form MorphX should display when users interact with the query. The default is SysQueryForm. |
|
UserUpdate |
Determines whether the query form should retain its state when it is reopened. If set to Yes, the previous settings are restored. If set to No, it is only possible to view the data; editing is forbidden. |
|
Version |
Read-only property. The version is increased every time the query is updated. |
|
Literals |
Determines how literals are represented in SQL statements. The forceLiterals statement instructs the kernel to reveal the actual values that are used in where clauses to the Microsoft SQL server database at the time of optimization. The forcePlaceholders statement instructs the kernel not to reveal the actual values. Note You are advised not to use the forceLiterals option, because it could expose code to an SQL injection security threat. |
|
Interactive |
Determines whether users can interact with the report by delimiting queries and setting printer options and so on. |
|
AllowCheck |
Ignored for queries. The AllowCheck property is effective on forms and reports. |
The following properties control the characteristics of a data source. Additional properties are available on embedded data sources and relations between data sources. You can also set one property on fields in the data source.
|
Property |
Available on |
Description |
|---|---|---|
|
Name |
Data source |
Determines the name of the data source. |
|
Table |
Data source |
Determines the table, map, or view that is used as a data source. This property cannot be modified after a sorting order or a range has been defined. |
|
UniqueId |
Data source |
Unique number for the data source (read-only). |
|
Company |
Data source |
Determines which company to retrieve data from. |
|
FirstOnly |
Data source |
If set to Yes, the database receives a hint that only the first record from the query is required. This allows some database systems to optimize record retrieval, and thus improve performance. |
|
FirstFast |
Data source |
If set to Yes, the database receives a hint that the first record from the query should be retrieved before the other records. This allows some database systems to optimize record retrieval, and thus improve performance. |
|
AllowAdd |
Data source |
Determines whether users can add fields to sorting and to ranges at run time. |
|
OrderMode |
Data source |
Determines whether the records should be fetched by using Order By or Group By. Used by functions like sum and avg. |
|
Update |
Data source |
Determines whether the query is allowed to update records in the database. |
|
Enabled |
Data source |
If set to No, the data source (and all embedded data sources) are ignored. |
|
Dynamic |
Fields node in a data source |
Determines whether all fields in the table in the data source are used. If set to Yes, all the fields in the data source are used. If set to No, you can remove some of the fields. |
|
FetchMode |
Embedded data source |
Determines whether the data sources should be related through a 1:1 relation or a 1:n relation. |
|
JoinMode |
Embedded data source |
Determines the strategy for how to join the output from a data source. For more information about join types, see Using multiple data sources in a query. |
|
Relations |
Embedded data source |
Determines if the query system should use the relations that are defined for tables and extended data types. If set to Yes, the query is automatically updated if a relation is changed. |
|
Table, RelatedTable |
Relations on an embedded data source |
The name of the parent data source and the related data source. |
|
Field, RelatedField |
Relations on an embedded data source |
The name of the fields from the parent data source and related data source that are used in the relation. |
The following properties control the sorting order for the query. For example, it is possible to set the sorting to ascending order.
|
Property |
Description |
|---|---|
|
Field |
Specifies which field to base the sorting on. |
|
Ordering |
Determines whether the records should be sorted in ascending or descending order. |
|
AutoHeader |
Available only for queries on reports. Determines whether a subheading should be printed whenever a value in the sort field changes. |
|
HeaderDetailLevel |
Available only for queries on reports. Enabled if AutoHeader is set to Yes. Enter a number to determine after how many subfields the header should be reinserted. |
|
AutoSum |
Available only for queries on reports. Determines if a group total is printed when the value in this field changes. |
|
SumDetailLevel |
Available only for queries on reports. Enabled if AutoSum is set to Yes. Enter a number to determine after how many subfields the sum should be reinserted. |
The following properties determine the characteristics of the range specification. For example, you can decide whether users are allowed to modify the range at run time.
|
Property |
Description |
|---|---|
|
Field |
Specifies which field to define a range on. |
|
Value |
Specifies the range for the retrieved records. If using enums, do not use text strings. The enum ID must be used. For information about the values you can enter for a range, see Elements of a query in the AOT and Expressions in query ranges. |
|
Label |
Allows you to enter a label for the range. |
|
Status |
Determines if users are allowed to modify the range in the query dialog at run time. Possible options are Open, Lock, or Hide. If the field is open, users can view and edit the range. If the field is locked, users can only view the range. If the field is hidden, the range cannot be seen or edited. |
|
Enabled |
Allows you to disable a field in a range specification. |