Formatovanie vystupu z sqlplus

Uzitocne v napr. skriptoch

COLUMN
Specifies display attributes for a given column, such as, column heading text, column heading alignment, data format, column data wrapping.
Also lists the current display attributes for a single column or all columns.

Syntax: COLUMN [ {column_name | expr} ] option
COL Lists current display attributes for all column_name currently defined.
COL column_name Lists current display attributes for column_name.
COL expr Lists current display attributes for expr.

ALIAS alias
Assign an alias to a column_name, which can be used by BREAK, COMPUTE, and other COLUMN commands. Example: COL em_salary+em_bonus ALIAS tot_income
CLEAR
Resets the display attributes for the column_name to default values. To reset the attributes for all column_name s, use the CLEAR COLUMNS command. CLEAR COLUMNS also clears the display attributes for that column_name.
FOLD_AFTER
Inserts a carriage return after the column heading and after each row in the column. SQLPlus does not insert an extra carriage return after the last column in the SELECT list.
FOLD_BEFORE
Inserts a carriage return before the column heading and before each row of the column. SQLPlus does not insert an extra carriage return before the first column in the SELECT list.
FORMAT format_model
Specifies the display format_model of the column. The format_model specification must be a text constant such as A10 or $9,999–not a variable. Example: COL emp_name FOR A15
HEADING text
Defines a column heading to text. If HEADING is not used, the column’s heading defaults to column_name or expr. If text contains blanks or punctuation characters, it must be enclosed with single or double quotes. Each occurrence of the HEADSEP character (by default, | (pipe) ) begins a new line. Example: COL last_name HEADING ‘Employee | Name’ produces a two-line column heading.
JUSTIFY {LEFT | CENTER | RIGHT}
Aligns the heading, not data. Without the JUSTIFY clause, headings for NUMBER columns default to RIGHT and headings for other column types default to LEFT.
LIKE {expr | alias}
Copies the display attributes of another column_name or expr (whose attributes which have already been defined with another COLUMN command). LIKE copies only attributes not defined by another clause in the current COLUMN command.
NEWLINE
Starts a new line before displaying the column’s value. NEWLINE has the same effect as FOLD_BEFORE.
NEW_VALUE variable
Specifies a variable to hold a column_name value. This variable can be referenced in the variable in TITLE commands. Use NEW_VALUE to display column values or the date in the top title.
NOPRINT | PRINT
Controls the printing of the column (the column heading and all the selected values). NOPRINT turns off the screen output and printing of the column. PRINT turns the printing of the column on.
NULL text
Replace a null value with ‘text’. The NULL clause of the COLUMN command overrides the SET NULL clause for a given column.
OLD_VALUE variable
Specify a variable to hold a column value. (see BTITLE)
ON | OFF
Controls the status of display attributes for a column. OFF disables the attributes for a column without affecting the attributes’ definition. ON reinstates the attributes.
WRAPPED | WORD_WRAPPED | TRUNCATED
Specifies how to treat long CHAR strings. WRAPPED wraps string within the column bounds, begins new lines when required. WORD_WRAP is enabled, SQLPlus left justifies each new line, skipping all leading whitespace (for example, returns, newline characters, tabs and spaces), including embedded newline characters.

Leave a Reply


Warning: Undefined variable $user_ID in /data/e/2/e2a12386-6c90-456e-9912-438742224460/papp.me.uk/sub/tomas/wp-content/themes/lighttheme/comments.php on line 54

You must be logged in to post a comment.