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-25
Preparing a SELECT Command
command to determine the system resources required to execute the query. For
descriptions of the PREPARE, EXECUTE, and EXPLAIN commands, see the SQL/MP
Reference Manual.
For example, suppose you want to print information about the orders from a customer
assigned to a specific sales representative. This report is produced each month for
sales representatives and all of their customers. You can create an command file that
contains a command to prepare the SELECT command.
This SELPREP file contains the following PREPARE command:
PREPARE SELCUSTINFO FROM
" SELECT * FROM SALES.CUSTOMER C, "
&" SALES.ORDERS R, "
&" SALES.ODETAIL OD, "
&" SALES.PARTS P "
&" WHERE C.CUSTNUM = R.CUSTNUM "
&" AND R.ORDERNUM = OD.ORDERNUM "
&" AND OD.PARTNUM = P.PARTNUM "
&" AND C.CUSTNUM = ? "
&" AND SALESREP = ?";
The SELECT command contains two unnamed parameters to be given values through
an EXECUTE command.
You can create another command file to produce the reports; this file is called
PRINTREP.
SET LIST_COUNT 0;
OUT_REPORT $S.#PRINTER
EXECUTE SELCUSTINFO USING 21, 223;
LIST ALL;
EXECUTE SELCUSTINFO USING 123, 226;
LIST ALL;
.
.
EXECUTE SELCUSTINFO USING 7777, 220;
LIST ALL;