The Display Clause

Top  Previous  Next

 

The optional display clause determines which fields (columns) are reported and how they are displayed. This clause is applicable to the LIST and SORT verbs only. If omitted, the query processor uses the default listing phrase to determine what is shown.

 

Fields appear in the report left to right in the order of the display clause elements. The default view of the record id (@ID) is always shown as the leftmost column unless it is suppressed using the ID.SUP keyword.

 

The display clause is constructed from the elements in the table below.

 

Prefix

Data Item

Suffix

AVG

D-type item

CONV "code"

PCT [n]

I-type item

FMT "spec"

TOTAL

EVAL "expr"  [AS xx]

COL.HDG "text"

MAX

Fn

ASSOC "name"

MIN

 

ASSOC.WITH field

BREAK.ON ["text"]

 

DISPLAY.LIKE field

BREAK.SUP ["text"]

 

SINGLE.VALUE

ENUM

 

MULTI.VALUE

CALC

 

NO.NULLS

CUMULATIVE

 

 

 

Each data item may optionally be prefixed by one of the qualifiers in the first column and followed by any number of compatible options from the third column.

 

Where no such item is defined in the dictionary or the VOC, the Fn data item is recognised by the query processor as a reference to field n, treating the data as single valued with a format code of "15T". These display characteristics can be modified using other elements from the table above.

 

 

Qualified Display Clauses

 

For improved compatibility with other multi-value databases, QM supports the concept of qualified display clauses. These combine the role of the display clause with simple selection clause elements. Because qualified display clauses lead to a potential ambiguity in the interpretation of a query, this feature must be enabled using the QUALIFIED.DISPLAY mode of the  OPTION command.

 

A qualified display clause element inserts a conditional test after the data item but before any items from the third column of the table above. This conditional test consists of an operator and a field or value against which the test is to be performed. It may not include the AND or OR operator or the use of brackets.

 

For example, the query

LIST STOCK SUPPLIER = 14 DESCRIPTION

would list the record id (default), SUPPLIER and DESCRIPTION fields, showing only those record where the SUPPLIER field contains 14. This is equivalent to

LIST STOCK SUPPLIER DESCRIPTION WITH SUPPLIER = 14

The optional display clause determines the manner in which records are reported. This clause is applicable to the LIST and  SORT verbs only.

 

There are a wide variety of options in this clause. Some determine the actual layout of the data while others set breakpoints at which totals, averages, etc are to be reported.