• Keine Ergebnisse gefunden

Dictionary Example

Im Dokument Open Desktop 3 (Seite 193-199)

Dictionary Example

The DICTIONARY example shows an example of a report that lists a glossary of ODT-DATA .1 terms, with a listing of related keywords. This demonstrates the use of some of the word- \ processing functions available in the Report-Writer. The base tables used are the following:

• The "dder' table contains names of terms and definitions of those terms.

• The "drer' table contains a list of terms and their related keywords.

Additional details on these table layouts are given in the following table.

ddef Table

An aggregate operator that first groups rows on the basis of the value of a (list of) column (called the

"by-list"), before computing the aggregate for each value of the "by-list."

An aggregate operator is a computation performed on a column across all rows in a table. Common ag-gregateoperators are SUM, COUNT, and AVG. Ag-gregate operators can have qualifications to limit the number of rows used in the calculation.

Another term for a "column" in a table.

Another term for the ODT-DATA "workspace."

Definition

180 Report-Writer Reference Manual DDT-DATA

(

;(

\

(

column

comparison operator

compressed

All data in ODT-DATA 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.

A symbol that specifies the kind of comparison to make in a qualification, such as ">" (for greater than), or "=" (for equality check).

Any of the ODT-DATA internal storage structures can be compressed. Compression reduces the storage re-quired for a table, by deleting all trailing blanks in character columns.

dref Table

Column information:

Column Name Type Length Key Sequence

word c

20

ref c

20

Word Ref

aggregate function aggregate operator

aggregate function aggregation

aggregate function by list

aggregate function computation

aggregate operator aggregate function

Dictionary Example

Column information:

Column Name Type Length Key Sequence

"

/

word c

20

ref c

20

-,

Word Ref

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

(

\"" /

182 Report-Writer Reference Manual DDT-DATA

(

(

(

The report-fonnatting statements are discussed below:

• The query used to create the data for the report simply joins words and definitions with a list of the related keywords. Therefore, the data returned to the report contains one row per related keyword. The .detail statements deals with the keywords, whereas the .heading word deals with the definition.

• The data are sorted by word, and within word, by related keyword.

• The left and right margins are set to specific values because the default margins calculated for the report do not reflect the required margins of the report.

• The report header simply puts out a page header.

• The header for "word" prints out the underlined word and the newspaper style printing of the definition. The "cjO.50" fonnat specifies a column fonnat 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).

Notice that no .newline statement is given, so that the next printing occurs at column 80 of the top line of the definition.

• The .detail statements simply print out the next related keyword for "word," until the next word is found. Because the fonnat specified for "ref' is "c20," it exactly fits within the temporary margins, and wraparound causes each keyword to be placed on a separate line. Remember that the .lmO statement in the header text for "word"

resets the left margin for printing a new word and definition.

• The footer for "word" simply finishes off the text for one "word" by printing out all the lines in the definition and related keyword list, and an extra line as well.

• The page header simply prints out a title, page number, and column headings.

Dictionary Example

/*

.NAME dict . QUERY

DICTIONARY - text example */

select ddef.word, ddef.definition, dref.ref from ddef, dref

where ddeLword = dreLword . SORT word, ref

.LM 0 .RM 100

• HEAD report .NEWPAGE 1 .HEAD word

.NE3.LMO

.UL .PR word(c25) .NOU

.P definition (cjO.50) .T80 .LM80

• DETAIL .P ref (c20) .FOOT word

.NL2 .HEAD page

.NL2

.P "Dictionary of ODT-DATA Terms"

.RT .P "Page", page_number .NL2

.UL .P "Word" .T definition .P "Definition"

.T80 .P "Related Term" .NOU .NL2 .FooT page

.NL 3

184 Report-Writer Reference Manual

/

DDT-DATA

Dictionary of ODT-DATA Terms

f

Word Definition Related Term

aggregate func- An aggregate operator that first groups aggregate tion rows on the basis of the value of a (list operator

of) column (called the "by-list"), aggregation before computing the aggregate for by list each value of the "by-list". computation aggregate An aggregate operator is a computation aggregate func-operator performed on a column across all rows tion

in a table. Common aggregate aggregation operators are SUM, COUNT, and AVG. computation Aggregate operators can have

qualifica-tions to limit the number of rows used in the calculation.

attribute Another term for "column" in a table. column

I buffer Another term for the DDT-DATA workspace

t

"workspace. "

column All data in DDT-DATA is saved in the attribute form of tables made up of rows and domain columns. In traditional database ter- field minology, a "column" is a "field" in a

record.

comparison A symbol that specifies the kind of qualification operator comparison to make in a qualification, restriction

such as ">" (for greater than), or "="

(for equality check).

compressed Any of the DDT-DATA internal storage character strings structures can be compressed. Compres- compression sion reduces the storage required for a storage structure

(

table, by deleting all trailing blanks in

character columns.

Im Dokument Open Desktop 3 (Seite 193-199)