SQL/MP Report Writer Guide

Customizing a Report
HP NonStop SQL/MP Report Writer Guide527213-001
4-28
Formatting Data Values
Text Inserted into a Line
You can insert text into a detail line, title, or footing by specifying a string literal as a
print item. Figure 4-13
illustrates this technique. You can use the technique to create
the following effects:
Insert commas between concatenated items.
Insert descriptions of an item that precedes or follows the string literal. For
example, the DETAIL, BREAK TITLE, and TITLE commands in the preceding
report definition include descriptive string literals.
You can also insert text in a line with AS clause decorations. For more information, see
Filler Characters
on page 4-38.
Formatting Data Values
You can use the AS clause to specify a display format for a print item that is a column
identifier, literal, arithmetic expression, or CONCAT clause. If you do not specify an AS
clause, or if you use the default report definition to display your data, the report writer
uses the default display formats shown in Table 4-1
.
The data type of a table column is defined in the catalog that contains the description
of the table.
Table 4-1. Default Display Formats (page 1 of 2)
SQL Data Type Default Display Format
Fixed-length Characters: An (or A255 if n > 255)
CHAR(n)
PIC X(n) DISPLAY
NATIONAL CHAR(n)
NCHAR(n)
Variable-length Characters:
VARCHAR(n)
NATIONAL CHARACTER
VARYING (n)
NCHAR VARYING(n)
NUMERIC(1,s) — NUMERIC (4,s) I6 (or F7.s if s > 0)
NUMERIC(1,s) UNSIGNED — I5 (or F6.s if s > 0)
NUMERIC(4,s) UNSIGNED
NUMERIC(5,s) — NUMERIC(9,s) I11 (or F12.s if s > 0)
NUMERIC(5,s) UNSIGNED — I10 (or F11.s if s > 0)
NUMERIC(9,s) UNSIGNED
NUMERIC(10,s) — NUMERIC(18,s) I20 (or F21.s if s > 0)