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-14
Developing a Query
Rows with part numbers between 2000 and 3000 or part numbers greater than 6000
are not selected. All other rows are selected.
Consider these points:
•
The AND that appears in a BETWEEN predicate does not connect two predicates
or search conditions.
•
You can specify NOT BETWEEN, NOT IN, and NOT LIKE, but you cannot specify
NOT =; you must use <> to indicate not equal.
Sorting the Data
The ORDER BY clause of the SELECT command determines the order in which rows
appear in the report. For example, the rows selected by the query in Figure 3-3 are
displayed in descending order by quantity available.
You can specify ascending or descending order, and you can specify more than one
column as the basis for sorting. For example, the query in Figure 3-4 selects entries in
which the quantity of parts ordered is greater than 30. The entries are arranged in
ascending order by part number and descending order by quantity ordered.
Figure 3-3. Example of Rows Sorted by One Column
Note. If you specify more than one column as a basis for sorting, all of the specified columns
should contain data from the same character set.
S >
>> SELECT
* FROM SALES . PARTS
+> WHERE QTY_AVAILABLE <= 2500
+> ORDER BY QTY_AVAILABLE DESCENDING;
S> LIST NEXT 11;
PARTNUM PARTDESC PRICE QTY_AVAILABLE
5101
7301
6301
6201
3205
2003
7102
2001
6401
6400
6603
MONITOR BW, TYPE 2
SMART MODEM, 2400
GRAPHIC CARD, HR
GRAPHIC CARD, LR
HARD DISK 30 MB
GRAPHIC PRINTER,MB
SMART MODEM, 1200
GRAPHIC PRINTER,M1
STREAMING TAPE,M60
STREAMING TAPE,M20
PRINTER CONTROLLER
200.00
425.00
245.00
195.00
625.00
2000.00
275.00
1100.00
725.00
550.00
45.00
2400
2332
2331
2306
2209
2200
2200
2100
1308
1268
430
VST0303.vsd