SQL/MX Report Writer Guide
Customizing a Report
HP NonStop SQL/MX Report Writer Guide—527194-002
4-18
Headings for Column Identifier Print Items
2. HEADING or NOHEAD clauses of the DETAIL command control headings for print
items. You can specify a heading with the HEADING option for a print item in the
detail list. You can also specify NOHEAD to suppress a heading for a print item.
3. Defined alias or detail names for the report provide headings of affected print
items.
4. A heading that exists as part of the column definition of a table or view provides a
heading for a print item specified by the column identifier. This heading is specified
when the database administrator creates or alters a view or table and stores it in
an SQL catalog. To display such a heading easily, select the column of the view or
table and display the results in the default report format. If the column heading is
different from the column name displayed by an INVOKE command entered in item
5, the column has a stored heading.
5. The column name is the default heading for a print item that is a column of a table
or view. The column name is defined when the database administrator creates the
table or view or adds the column to the table or view. To display column names,
use the INVOKE command to display a table or view definition.
6. The heading EXPR is the default heading for expressions, functions, and numeric
literals specified in the DETAIL command.
7. No heading is the default for string literals, IF/THEN/ELSE items, and CONCAT
items specified in the DETAIL command.
This example shows how to specify a heading for a print item in a DETAIL command.
The DETAIL command defines a heading for DEPTNUM, specifies no heading for
DEPTNAME, and accepts the default heading for LOCATION.
>> SELECT * FROM DEPT
+> ORDER BY DEPTNUM;
S> DETAIL DEPTNUM HEADING 'DEPARTMENT',
+> DEPTNAME NOHEAD,
+> LOCATION;
S> LIST NEXT 2;
DEPARTMENT LOCATION
---------- -----------
1000 FINANCE CHICAGO
1500 PERSONNEL CHICAGO
S>
To specify a heading for the concatenated names of employees, enter:
>> SELECT * FROM EMPLOYEE E, JOB
+> WHERE E.DEPTNUM = 4000
+> AND E.JOBCODE = JOB.JOBCODE;
S> DETAIL EMPNUM HEADING 'Employee No.',
+> CONCAT (FIRST_NAME STRIP, SPACE 1, LAST_NAME)
+> AS A25 HEADING 'Name' CENTER,
+> JOBDESC HEADING 'Job Title' CENTER ;