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-36
Developing Multistep Queries
3. Select the information for the report. Include an expression in the select list to
compute the percent of the department average:
>> SELECT E.DEPTNUM, EMPNUM, LAST_NAME, SALARY,
+> SALARY/AVGSAL*100.00
+> FROM PERSNL.EMPLOYEE E, TEMPTABS.AVGTEMP A
+> WHERE E.DEPTNUM = A.DEPTNUM;
S> DETAIL DEPTNUM, EMPNUM, LAST_NAME,
+> SALARY AS F10.2,
+> COL 5 AS F10.2 HEADING "PCT OF AVG";
S> LIST ALL;
DEPTNUM EMPNUM LAST_NAME SALARY PCT OF AVG
------- ------ ---------------- ---------- ----------
1000 23 HOWARD 137000.10 263.46
1000 202 CLARK 25000.75 48.08
1000 208 CRAMER 19000.00 36.54
. . . . .
. . . . .
. . . . .
9000 1 GREEN 175500.00 165.00
9000 337 CLARK 37000.00 34.82
--- 57 row(s) selected.
>>
You can drop the temporary table or purge the data and keep the table for use in
producing future reports.