Formatting Columns
Formatting SQL*Plus
Reports
6-5
Default Display
The default width of datatype columns is the width of the column in the database. The
column width of a LONG, BLOB, BFILE, CLOB, NCLOB or XMLType defaults to the
value of
SET LONGCHUNKSIZE or SET LONG, whichever is the smaller.
The default width and format of unformatted DATE columns in SQL*Plus is
determined by the database NLS_DATE_FORMAT parameter. Otherwise, the default
format width is A9. See
the FORMAT clause of the
COLUMN
command on page 12-26
for more information on formatting DATE columns.
Left justification is the default for datatypes.
Changing the Default Display
You can change the displayed width
of a datatype or DATE, by using the COLUMN
command with a format model consisting of the letter A (for alphanumeric) followed
by a number representing the width of the column in characters.
Within
the COLUMN command, identify the column you want to format and the
model you want to use:
COLUMN
column_name
FORMAT
model
If you specify a width shorter than
the column heading, SQL*Plus truncates the
heading. See the
COLUMN
command on page 12-26 for more details.
Example 6–5
Formatting a Character Column
To set the width of the column LAST_NAME to four characters and rerun the current
query, enter
COLUMN LAST_NAME FORMAT A4
/
If the WRAP variable of the SET command is set to ON (its default value), the
employee names wrap to the next line after the
fourth character, as shown in
LAST MONTHLY
NAME
SALARY COMMISSION
---- -------- ----------
Russ $14,000 .4
ell
Do'stlaringiz bilan baham: