Was this helpful?
DICTIONARY Example
The DICTIONARY example shows an example of a report that lists a glossary of Ingres terms, with a listing of related keywords. This demonstrates the use of some of the word‑processing functions available in Report-Writer. The following base tables are used:
The “ddef” table, which contains names of terms and definitions of those terms
The “dref” table, which contains a list of terms and their related keywords
Additional details on each of these table layouts are provided in the tables that follow:
Dref Table Definition
Column Name
Type
Length
Nulls
Defaults
word
char
20
yes
no
definition
char
250
yes
no
Ddef Data for the Sample Report
Word
Definition
aggregate function
An aggregate operator which first groups rows on the basis of the value of a column or list of columns called the by‑list, before computing the aggregate for each value of the by‑list.
aggregate operator
An aggregate operator is a computation performed on a column across all rows in a table. Common aggregate operators are SUM, COUNT, and AVG. Aggregate operators can have qualifications to limit the number of rows used in the calculation.
attribute
Another term for a column in a table.
buffer
Another term for the Ingres workspace.
column
All data in Ingres is saved in the form of tables made up of rows and columns. In traditional database terminology, a column is a field in a record.
comparison operator
A symbol which specifies the kind of comparison to make in a qualification, such as > (for greater than), or = (for equality check).
compressed
Any of the Ingres internal storage structures can be compressed. Compression reduces the storage required for a table, by deleting all trailing blanks in character columns.
Dref Table
Column Name
Type
Length
Nulls
Defaults
Word
char
20
yes
no
Ref
char
20
yes
no
Dref Data for the Sample Report
Word
Ref
aggregate function
aggregate operator
aggregate function
aggregation
aggregate function
by list
aggregate function
computation
aggregate operator
aggregate function
aggregate operator
aggregation
aggregate operator
computation
Attribute
column
Buffer
workspace
Column
attribute
Column
domain
Column
field
comparison operator
qualification
comparison operator
restriction
Compressed
character strings
Compressed
compression
Compressed
storage structures
The report formatting statements are described here:
The query used to create the data for the report joins words and definitions with a list of the related keywords. Therefore, the data returned to the report contains one row for each related keyword. The .detail section statement pertains to the related keywords, and the .head word statement pertains to the word itself and the definition.
Report-Writer sorts the data by word, and within word, by related keyword.
The report specification sets the left and right margins to specific values because the default margins calculated for the report do not reflect the required margins of the report.
The .head report section statement performs a page break and prints a page header at the top of the page.
The .head statement for "word" prints out the underlined word and the newspaper style printing of the definition. The cj0.50 format specifies a column format 50 spaces wide, with right justification, with printing occurring until the end of the string. The .t80 statement then moves to position 80 (5 spaces to the right of the edge of the definition), and sets the left margin of the report to that position. This causes all printing to wrap around between the left margin (80) and the right margin (100). No .newline statement is given, so that the next printing occur at column 80 of the top line of the definition.
The .detail section statement prints out the next related keyword for "word," until the next word is found. Because the format specified for ref is c20, it exactly fits within the temporary margins, and wrap‑around format causes each keyword to appear on a separate line. Remember that the .lm0 statement in the header text for "word" resets the left margin for printing a new word and definition.
The .foot statement for "word" finishes the text for one "word" by printing out all the lines in the definition and related keyword list, and prints a blank line.
The .head page section statements print out a title, page number, and column headings.
/* DICTIONARY - text example */
.NAME dict
.OUTPUT dict.out
.LONGREMARK
The DICTIONARY report demonstrates the use of character printing options
within the Report-Writer. It lists a glossary of Ingres terms,
with a listing of related keywords. This demonstrates the use of some
of the word-processing functions available in the Report-Writer.
.ENDREMARK
.QUERY
    select ddef.word, ddef.definition, dref.ref
    from ddef ddef, dref dref
    where ddef.word = dref.word
.SORT word, ref
.LM 0
.RM 100
.HEAD report
    .NEWPAGE 1
.HEAD word
    .NE 3 .LM 0
    .UL .PR word(c25) .NOU
    .P definition(cj0.50)
    .T80 .LM80
.DETAIL
    .P ref(c20)
.FOOT word
    .NL 2
.HEAD page
    .NL 2
    .P 'Dictionary of Ingres Terms'
    .RT .P 'Page', page_number .NL 2
    .UL .P 'Word' .T definition .P 'Definition'
    .T80 .P 'Related Term' .NOU .NL 2
.FOOT page
    .NL 3
 
Dictionary of 
Ingres Terms
Page 1
Related Term
Word
Definition
 
aggregate function
An aggregate operator which first groups rows on the basis of the value of a (list of) column(s) (called the "by-list"), before computing the aggregate for each value of the "by-list."
aggregate operator
aggregation
by list
computation
aggregate operator
An aggregate operator is a computation performed on a column across all rows in a table. Common aggregate operators are SUM, COUNT, and AVG. Aggregate operators can have qualifications to limit the number of rows used in the calculation.
aggregate function
aggregation
computation
attribute
Another term for "column" in a table.
column
buffer
Another term for the Ingres "workspace".
workspace
column
All data in Ingres is saved in the form of tables made up of rows and columns. In traditional database terminology, a "column" is a "field" in a record.
attribute
domain
field
comparison operator
A symbol which specified the kind of comparison to make in a qualification, such as ">" (for greater than), or "=" (for equality check).
qualification
restriction
compressed
Any of the Ingres internal storage structures can be compressed. Compression reduces the storage required for a table, by deleting all trailing blanks in character columns.
character strings
compression
storage structure
Last modified date: 08/14/2024