COLUMN
Syntax
COLUMN [<name>]; -- Displays configuration
COLUMN <name> <command>; -- Changes configuration
Description
Displays the formatting settings for the <name>
column or changes the formatting options for the <name>
column.
<command>
can be a combination of one or more of the following options:
Command | Description |
---|---|
ON
|
Enables formatting settings for the relevant column. |
OFF
|
Disables formatting settings for the relevant column. |
FORMAT <format>
|
Sets the Example: Format strings of numbers consist of the elements '9', '0', '.' (point) and 'EEEE'. The width of the column results from the length of the specified format string.
The following rules apply:
Example: A |
CLEAR
|
Deletes the formatting options for the relevant column. |
JUSTIFY <LEFT|RIGHT|CENTER>
|
Defines the alignment of the column name. |
LIKE <column>
|
Copies all formatting options from the specified column. |
WORD_WRAPPED
|
The values of the relevant column will, if possible, be wrapped between the individual words. |
WRAPPED
|
The values of the relevant column will be wrapped at the right margin of the column. |
TRUNCATED
|
The values of the relevant column will be trimmed at the right margin of the column. |
NULL <text>
|
NULL values of the relevant column will be displayed as <text>. |
HEADING <text>
|
Sets a new heading for the relevant column. |
ALIAS <text>
|
Sets an alias name for the relevant column. |
The following "COLUMN" SQL*Plus
statements are not supported. However, for reasons of compatibility they
will not generate a syntax error:
NEWLINE
NEW_VALUE
NOPRINT
OLD_VALUE
PRINT
FOLD_AFTER
FOLD_BEFORE
Examples
SQL_EXA> column A;
COLUMN A ON
FORMAT 9990
SQL_EXA> column A format 90000.0;
SQL_EXA> column b format 99990;
SQL_EXA> column b just left;
SQL_EXA> select a,a as b from ty;
Results
A | B |
---|---|
0011.0 | 11 |
0044.0 | 44 |
0045.0 | 45 |
0019.0 | 19 |
0087.0 | 87 |
0099.0 | 00 |
0125.0 | 33 |
0442.0 | 442 |