Sql*Plus User’s Guide and Reference


Example 6–2 Splitting a Column Heading


Download 5.34 Mb.
Pdf ko'rish
bet79/103
Sana04.08.2023
Hajmi5.34 Mb.
#1665146
1   ...   75   76   77   78   79   80   81   82   ...   103
Bog'liq
E18404-12

Example 6–2
Splitting a Column Heading
To give the columns SALARY and LAST_NAME the headings MONTHLY SALARY 
and LAST NAME respectively, and to split the new headings onto two lines, enter
COLUMN SALARY HEADING 'MONTHLY|SALARY'
COLUMN LAST_NAME HEADING 'LAST|NAME'
Now rerun the query with the slash (/) command:
/
Example 6–3
Setting the Underline Character
To change the character used to underline headings to an equal sign and rerun the 
query, enter the following commands:
SET UNDERLINE =
/
LAST NAME MONTHLY SALARY COMMISSION
------------------------- -------------- ----------
Russell 14000 .4
Partners 13500 .3
Errazuriz 12000 .3
Cambrault 11000 .3
Zlotkey 10500 .2
Note:
The new headings will remain in effect until you enter 
different headings, reset each column's format, or exit from SQL*Plus.
LAST MONTHLY
NAME SALARY COMMISSION
------------------------- ---------- ----------
Russell 14000 .4
Partners 13500 .3
Errazuriz 12000 .3
Cambrault 11000 .3
Zlotkey 10500 .2


Formatting Columns
Formatting SQL*Plus Reports
6-3
Now change the underline character back to a dash:
SET UNDERLINE '-'
Formatting NUMBER Columns
When displaying NUMBER columns, you can either accept the SQL*Plus default 
display width or you can change it using the COLUMN command. Later sections 
describe the default display and how you can alter it with the COLUMN command. 
The format model will stay in effect until you enter a new one, reset the column's 
format with
COLUMN 
column_name
CLEAR
or exit from SQL*Plus.
Default Display
A NUMBER column's width equals the width of the heading or the width of the 
FORMAT plus one space for the sign, whichever is greater. If you do not explicitly use 
FORMAT, then the column's width will always be at least the value of SET 
NUMWIDTH.
SQL*Plus normally displays numbers with as many digits as are required for accuracy, 
up to a standard display width determined by the value of the NUMWIDTH variable 
of the SET command (normally 10). If a number is larger than the value of SET 
NUMWIDTH, SQL*Plus rounds the number up or down to the maximum number of 
characters allowed if possible, or displays hashes if the number is too large.
You can choose a different format for any NUMBER column by using a format model 
in a COLUMN command. A format model is a representation of the way you want the 
numbers in the column to appear, using 9s to represent digits.

Download 5.34 Mb.

Do'stlaringiz bilan baham:
1   ...   75   76   77   78   79   80   81   82   ...   103




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©fayllar.org 2024
ma'muriyatiga murojaat qiling