SQL/MX Report Writer Guide

Introduction to the NonStop SQL/MX Report Writer
HP NonStop SQL/MX Report Writer Guide527194-002
1-6
Default Report Format
Default Report Format
You can display or print a report without specifying any report formatting commands,
layout options, or style options. The report is produced in the default format and is
called the default report. The tables referred to are in the same catalog and schema,
so your default catalog and schema should have been set at the beginning of this
session. See Setting Up Your Session Environment on page 2-2 for details on setting
the default catalog and schema.
Figure 1-2 shows a default report produced with these commands:
>> MODE REPORT;
>> SELECT P.PARTNUM, PARTDESC, QTY_ORDERED, ORDERNUM
+> FROM PARTS P, ODETAIL O
+> WHERE P.PARTNUM = O.PARTNUM
+> AND ( P.PARTNUM < 300
+> OR P.PARTNUM >= 6500 )
+> ORDER BY P.PARTNUM, ORDERNUM ;
S> LIST ALL;
The report contains a detail line for each row retrieved by the SELECT command. A
row must meet the criteria specified in the WHERE clause: the part number must be
less than 300 or greater than or equal to 6500.
The ORDER BY clause specifies that rows are arranged in ascending order by part
number and, for each part number, in ascending order by order number.
Figure 1-2. Default Report Layout
PARTNUM
212
212
244
244
244
244
244
244
255
255
255
255
6500
6500
6500
7102
7102
7102
7301
7301
7301
7301
PARTDESC
PC SILVER, 20 MB
PC SILVER, 20 MB
PC GOLD, 30 MB
PC GOLD, 30 MB
PC GOLD, 30 MB
PC GOLD, 30 MB
PC GOLD, 30 MB
PC GOLD, 30 MB
PC DIAMOND, 60 MB
PC DIAMOND, 60 MB
PC DIAMOND, 60 MB
PC DIAMOND, 60 MB
DISK CONTROLLER
DISK CONTROLLER
DISK CONTROLLER
SMART MODEM, 1200
SMART MODEM, 1200
SMART MODEM, 1200
SMART MODEM, 2400
SMART MODEM, 2400
SMART MODEM, 2400
SMART MODEM, 2400
QTY_ORDERED
12
8
3
4
8
20
6
6
10
12
12
4
10
8
22
7
5
6
8
36
40
12
ORDERNUM
400410
500450
100210
100250
200300
300350
300380
800660
101220
400410
500450
700510
100250
700510
800660
101220
700510
800660
101220
400410
600480
800660
Default
Headings
Default Detail
Lines
VST0102.vsd