Table of Contents

About

The column command:

  • specifies display attributes for a given column, such as:
    • text for the column heading
    • alignment for the column heading
    • format for NUMBER data
    • wrapping of column data
  • lists the current display attributes for a single column or all columns.
  • can set a substitution variable from a sql via the sql column name

Syntax

COL[UMN] [{column | expr} [option ...] ]

where:

  • column is the column name of an SQL
  • option represents one of the following clauses:
Options Description
ALI[AS] alias
CLE[AR] To Suppress the formatting of the column. See FORMAT
ENTMAP {ON|OFF}
FOLD_A[FTER]
FOLD_B[EFORE]
FOR[MAT] format To format the report. See FORMAT
HEA[DING] text Define the headers text of the column. With the |, you can go to the line.
JUS[TIFY] {L[EFT] | C[ENTER] | R[IGHT]} Define the justification (Default: Left)
LIKE {expr | alias} See copy
NEWL[INE]
NEW_V[ALUE] variable will set the substitution variable variable with the value of the column name of the SQL
NOPRI[NT] | PRI[NT] will not print (hide) the column
NUL[L] text See Null
OLD_V[ALUE] variable
ON|OFF
WRA[PPED] | WOR[D_WRAPPED] | TRU[NCATED] See wrap

Options

Heading

The heading option controls the headers.

COLUMN TABLE_NAME HEADING 'Table|Name'

will produce for the column TABLE_NAME the following output:

Table
Name

Management

Copy

The LIKE clause copies the display attributes of a previously defined column to the new column, except for changes made by other clauses in the same command.

Example: To give the column COMMISSION_PCT the same display attributes you gave to SALARY, but to specify a different heading, enter the following command:

COLUMN COMMISSION_PCT LIKE SALARY HEADING BONUS

Suppress

for one column

You can reset the column's format with

COLUMN column_name CLEAR

or exit from SQL*Plus.

for all columns

See clear

See

all

column

one

column column_name