SQL/MP Report Writer Guide
Table Of Contents
- What’s New in This Manual
- About This Manual
- 1 Introduction to the NonStop SQL/MP Report Writer
- 2 Using SQLCI and the Report Writer
- 3 Selecting Data for a Report
- 4 Customizing a Report
- Defining the Layout
- Specifying the Items in a Detail Line
- Naming Select List and Detail Line Items
- Organizing Rows Into Break Groups
- Labeling Information
- Formatting Data Values
- Formatting Dates and Times
- Using TACL to Pass Parameters
- Conditional Printing of Items or Line Entries
- Redefining Special Characters
- Calculating Totals
- Calculating Subtotals
- Printing Double-Byte Characters
- A Comparison of the Report Writer and the Enform Language
- Index

Selecting Data for a Report
HP NonStop SQL/MP Report Writer Guide—527213-001
3-2
Developing a Query
After you know what information you want, you can compose a SELECT command to
retrieve the data. The SELECT command must retrieve all the data you need, including
information in columns, titles, headings, and footings. In the following pages, one
approach to composing a SELECT command is presented.
Figure 3-1 illustrates the general content of a report on suppliers and the parts they
supply. The italicized words date and time, and the numbers below the column
headings are notes about what data is needed to produce the report.
Locating the Data
First, you must determine which database tables contain the data. The example in
Figure 3-1 uses data from the SUPPLIER, PARTSUPP, and PARTS tables. The report
contains the following data in the numbered output line items:
1 PARTS.PARTNUM
2 PARTS.QTY_AVAILABLE
3 PARTSUPP.PARTCOST
4 PARTSUPP.PARTCOST * PARTS.QTY_AVAILABLE
5 PARTS.QTY_AVAILABLE * (PARTS.PRICE - PARTSUPP.PARTCOST)
Each column name in this list is qualified by the name of the table that contains the
column. You can use the INVOKE command to determine the names of columns in a
table.
The report title includes the date and the time when the report is produced. These
values are to be provided through the CURRENT_TIMESTAMP function.