logo


    Chapter 58


    Reports: Query Store

58.1.0 Introduction

What it can do

The Query Editor allows you to define multiple-field And and Or queries, as well as a multiple-field Except queries. The Query Editor allows you to query across tables. It also allows you to do Set math on selections of records as well as Joins. Lastly it allows you to Order a selection of records. If these terms are not familiar to you - do not worry - we will explain these later.

Differences to the normal Query Editor

If you have used other 4th Dimensions Databases before, you will notice that our Query Editor is very different to the Standard Editor.

The reasons for this are as follows:

a The Standard Editor does not do Set Math or Joins.

b The Standard Editor is not very intuitive and difficult for inexperienced users.

c The Standard Editor does not give prompts as to the type of field being Queried.

d The Standard Editor has problems with circular relations.

e The Standard Editor does not allow Comments to document a complex Query.

f The Standard Editor does not allow Order By and Order By Formula.

Our implementation eliminates all the above deficiencies.

Sets and Selections

You will often come across the terms Selection and Set in this section. Knowing the difference is CRUCIAL in order to understand what is going on as you construct your Query.

Here is a definition of a Selection

A Selection is an object that may contain some records from a single Table. There is only ONE selection of records for EVERY Table in the database. This selection may be EMPTY i.e. have no records in it.

Here is a definition of a Set

A Set is an object that tells STATIC which records from a Table are contained in the Set. You can have MANY Sets for EVERY Table in the STATIC - if you have enough memory.

Note: In STATIC, a Set is an array of Boolean values in which EVERY record for a Table is represented. If a record is in the Set then it is represented by a 1, if it is not in the Set then it is represented by a 0. As Sets are basically arrays, and because arrays are manipulated in memory, Set operation is very fast - almost instantaneous.

Conversion of Set and Selection

You can convert a Set to a Selection by the command Use Set.

Almost every command creates a Set but you can convert a Selection to a Set by the command Create Set - you will only rarely find a use for this.

You will notice that whenever you select a command that you will be informed what type of action is occurring; for instance when you select the Query command the green label informs you that you are creating a Set:

 

Query: Sets and Selections



Harrowex Pty Ltd
http://www.hxmedical.com
Voice:+ 61 4 27 344 279
Fax: +61 3 52 439 019
static@hxmedical.com