SQL/MP Report Writer Guide

Customizing a Report
HP NonStop SQL/MP Report Writer Guide527213-001
4-7
Defining the Layout
The NEED clause is useful when you want to keep a set of lines together, such as a
complete address. In the next example, a page break will not occur in the middle of
information about a single supplier.
>> SELECT * FROM INVENT.SUPPLIER
+> ORDER BY SUPPNAME;
S> DETAIL NEED 4, "Supplier No.", SUPPNUM NOHEAD, SKIP 1,
+> SUPPNAME NOHEAD, SKIP 1,
+> STREET NOHEAD, SKIP 1,
+> CONCAT (CITY STRIP, ", ", STATE STRIP,
+> SPACE 1, POSTCODE) NOHEAD,
+> SKIP 1 ;
S> SET LAYOUT PAGE_LENGTH 14;
S> LIST FIRST 4;
Figure 4-4 shows the first 4 rows of output. The column of numbers on the right does
not appear in the report; the numbers indicate the 14 lines on each page. The third
detail line appears on the second page because only 3 more lines are available on the
first page.