SQL Plus - Column Command

Card Puncher Data Processing

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





Discover More
Card Puncher Data Processing
SQL Plus - Clear

CLEAR resets or erases the current value or setting for the specified option. where option represents one of the following clauses: BRE[AKS] BUFF[ER] COL[UMNS] COMP[UTES] SCR[EEN] SQL...
Card Puncher Data Processing
SQL Plus - Command Reference

Commands Description @ @@ / ACCEPT APPEND ARCHIVE ATTRIBUTE BREAK BTITLE CHANGE CLEAR COLUMN COMPUTE CONNECT COPY Copies data from a query to a table in the same or another...
Card Puncher Data Processing
SQL Plus - Formatting Reports

How to format SQLplus output (ie ) All below parameters can be configured in the login script. Through the SQLPlus COLUMN command with the heading options, you can change the column headings...
Card Puncher Data Processing
SQL Plus - Null

The value to show when a NULL value is found in the database can be set: globally through the NULL system variable or by column through the NULL option
Card Puncher Data Processing
SQL Plus - Substitution Variables

You can define variables, called substitution variables, for repeated use in a single script. Note that you can also define substitution variables to use in titles and to save your keystrokes (by defining...
Card Puncher Data Processing
SQL Plus - Wrap

Wrap is a feature of SQL Plus that can be set: globally with a system variable by column with the command Wrap is a system variable that turns on or off (default) globally the truncating of...



Share this page:
Follow us:
Task Runner